Doubt in JSP

hi ,
i was new to JSP, when iam learning jsp, i worte a jsp file for performing session tracking using jsp:usebean tag , for that i create a bean and i generate a class and i put that class in classes folder.
here i got a problem, when i call this in browser i got an error...... class not found. after trying 3 to 4 times i got the same error. i dont know why the error. i wrote all the code correctly and i deploy my application perfectly.
after that i got an idea to put that class in a package now i got the result without any error.
Why did we create a new package to perform beans????????

There's no doubt in my mind you are correct. :)
Or did I just prove you wrong beyond a doubt? ;)
Neither. He used the construct "to have a doubt" as a verb, which is incorrect as the word can't be used like that.
Of course even if it could the very meaning of the word is quite different from the intended "question" as "doubt" doesn't mean question at all but rather "reservation" (and no, that's not a reservation to a theater seat or restaurant table).

Similar Messages

  • Doubt in JSP recordset

    Hi i have a doubt in jsp...first i don know much abt jsp so iam gonna trying out a project on supermarket system.Here i have three tables Items,Bill and Report.Iam using three resultset continuously and i have error saying no resultset found.I have sent the code can anyone plz help me correcting it.
    <%
    String item= request.getParameter("itemadd");
    String qr=request.getParameter("quanreq");
    HttpSession Dsess=request.getSession();
    String refer = (String)Dsess.getAttribute("user");
    Date dd = new Date();
    SimpleDateFormat sdf1 = new SimpleDateFormat("dd");
    String date = sdf1.format(dd);
    Date mm = new Date();
    out.println(date);
    SimpleDateFormat sdf2 = new SimpleDateFormat("MMM");
    String mon = sdf2.format(mm);
    Date yy = new Date();
    SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy");
    String year = sdf3.format(yy);
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con=DriverManager.getConnection("jdbc:odbc:honeydew"," "," ");
         Statement st= con.createStatement();
         ResultSet rs = st.executeQuery("Select * from Items where Iname = '"+item+"' ");
         String uni = new String();
         String pri = new String();
         while(rs.next())
              uni = rs.getString(4);
              pri = rs.getString(5);
         ResultSet rs4 = st.executeQuery("update Items set Quantity = Quantity - '"+qr+"' where Iname ='"+item+"' ");
         ResultSet rs2 = st.executeQuery("insert into Bill values('"+item+"','"+qr+"','"+uni+"','"+pri+"','"+refer+"')");
         ResultSet rs2 = st.executeQuery("insert into Report values('"+item+"','"+qr+"','"+uni+"','"+pri+"','"+date+"','"+mon+"','"+year+"')");
    catch(Exception e)
    %>
    <html>
    <body bgcolor="#CCDDEF">
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.lang.*" %>
    <%@ page import = "java.util.Date" %>
    <%@ page import = "java.text.*" %>

    Hi
    When you are doing either update or insert database operations, use Statement.executeUpdate("insert . . . . "), which will return how many rows are effected. So instead of
    ResultSet rs1 = stmt.executeQuery("update ......"); use the following
    stmt.excuteUpdate("update ...... ");

  • Help me -doubt in jsp

    hai
    In my jsp page one checkbox is there.
    when i check the checkbox then another on textarea will popup
    and vice versa
    plese help me
    it is very urgent
    thank you

    * dont doubt JSP it has proven its worth.
    * checking checkbox and hidding/showing textareas is not in your JSP but in the HTML that is send to your client by making a request to your JSP, its a detail but a very important one
    * This means you need Javascript that will change the style of yor HTML components, have a look at a javascript onclick or onchange events and at the DOM model.
    * example
    yourtextarea.style.visibility = 'hidden'

  • Simple Doubt in JSP

    I have a set of check boxes and corresponding text boxes in a HTML form. I want to display the text box value if the corresponding check box is checked.
    Can anybody tell me how to accomplish this?

    I have a set of check boxes and corresponding text
    boxes in a HTML form. I want to display the text box
    value if the corresponding check box is checked.
    Can anybody tell me how to accomplish this?when are you trying to display the text box value? After they hit a submit button or something? If thats true then you can if you want write a servlet or jsp which will handle the POST action. Then you can get the value depending on what you named it in them in the JSP.
    So if you named your field something like:
    <input type="text" name="text_one"/><input type="checkbox" name="mycheckbox" value="one"><br>
    <input type="text" name="text_two"/><input type="checkbox" name="mycheckbox" value="two"><br>
    <input type="text" name="text_three"/><input type="checkbox" name="mycheckbox" value="three"><br>
    Now you can do:
    String[] checkBoxValues = request.getParameterValues("mycheckbox");
    for(int i = 0; i < checkBoxValues.length; i++) {
    if(checkBoxValues.equals("one"))
    System.out.println(request.getParameter("text_one");
    else if(checkBoxValues[i].equals("two"))
    System.out.println(request.getParameter("text_two");
    else if(checkBoxValues[i].equals("three"))
    System.out.println(request.getParameter("text_three");
    Obviously there probably way better ways to do this but this should at least lead you in the right direction.
    -Chuy

  • Doubt in jsp or oracle

    hi everyone,
              i'm working with a jsp code which uses oracle as backend i come across
              a statement like this
              rs2=st2.executeQuery("select name from emp where ecode='"+ecode+"'");
              what the + mean in --"+ecode+"
              is it related to jsp or oracle,
              help me in bebuging the code
              

              That is from your JSP, "ecode" in ecode is a variable in your JSP.
              [email protected] (kasi) wrote:
              >hi everyone,
              >i'm working with a jsp code which uses oracle as backend i come across
              > a statement like this
              >
              >rs2=st2.executeQuery("select name from emp where ecode='"+ecode+"'");
              >
              >what the + mean in --"+ecode+"
              >is it related to jsp or oracle,
              >help me in bebuging the code
              

  • IN JSp : How to validate textbox of same name?

    Hi..
    Im having doubt in jsp & its urgent need for me..help out...
    Im having multiple html textbox of same name. Onclicking that textbox
    i have to call one JS page that creates calendar window which returns date
    to same textbox after selection.
    For single textbox, the values returns corretly..for multiple it doesnt return
    the value..coz of same name i think..
    Code:
    <script language="JavaScript" src="CmJavaScript.JS" ></script>
    <td class="table-text-tab"><input type=text name=a_date onClick=javascript:showcal('testForm.this.value'); value=<%=rs0.getString(5)%> size=13>
    <td class="table-text-tab"><input type=text name=f_date onClick=javascript:showcal('testForm.this.value'); value=<%=rs0.getString(7)%> size=13>
    Here showcal is the functionname & testform is the form name.
    here this two table data will be looped till the end of record selection.
    for example if i select 2 records in previous page..this code will be executed twice & will display textbox twice with same name..
    ie
    a_date ------------ f_date -----------
    a_date ------------ f_date -----------
    if i click first a_date textbox it populates calendar thru JS which returns date.
    bcoz of same textbox name..it doesnt returns the value...
    i mean its confused where to return whether in 1st (r) 2nd textbox?

    The same rule applies for textboxes as for checkboxes with the same name - indeed for any components accessed in the dom via javascript.
    If there is only one element of that name, it is accessed directly.
    If there is more than one element of that name, it reveals them as an array.
    so document.testForm.a_date would return an array of input fiels
    document.testForm.a_date[0], document.testForm.a_date[1] ... document.testForm.a_date[n]
    However the order of submission of parameters is NOT guarunteed, which is why people normally DON'T have fields in this manner - because you can't know for certain that a_date[1] matches with b_date[1] at the server end.
    The common practice is to give each field a unique name (numbered).

  • Can we include a JSP page in an already included JSP Page

    Hi guys,
    I have a doubt with JSP include tag. The problem is ..
    Can we include a JSP page in an already included JSP Page
    AS shown below
    I have one JSP page
    Index.jsp
    -in this I am including "include.jsp"
    -Again within the "include.jsp" I am including "include1.jsp"
    It is neither giving an error nor displaying the content which is there in the "include1.jsp" but it is displaying the content of "include.jsp"
    first of all let me know whether it is possible or no.. If so then why is it not coming and what is required to do this..
    fast...
    Thanks
    Sreenadha Reddy K

    Hi guys,
    I have a doubt with JSP include tag. The
    g. The problem is ..
    Can we include a JSP page in an already included JSP
    Page
    AS shown below
    I have one JSP page
    Index.jsp
    -in this I am including "include.jsp"
    -Again within the "include.jsp" I
    he "include.jsp" I am including "include1.jsp"
    It is neither giving an error nor displaying the
    content which is there in the "include1.jsp" but it is
    displaying the content of "include.jsp"
    first of all let me know whether it is possible or
    no.. If so then why is it not coming and what is
    required to do this..
    fast...
    Thanks
    Sreenadha Reddy KIt is possible , u just have to change all the files and save them all again, clear the temp dirs where all the jsp's as compiled. Now after all this try , it should work .

  • How to send query string by using form action

    Hai to all,
    I am new to this topic Ihave one doubt about jsp form action....
    That is I am using input type is submit button
    <input type="submit" name="submit" value="Edit" onclick="indows.location.href=+sample.jsp?query=+editvalue+editname">
    If I get that queryString in the sample.jsp page it respoce to the null only...... what is the problem to this code ..... please send ur perfect coding as soon as possible. I really waiting for ur replay..........

    Hai,
    I think u can use the "request.getQueryString()" to get the query string instead of using "request.getParameter()".
    From the query string value u can get the output.
    cheers,
    Redrose

  • How to refer javascript in servlets

    Hi friends,
    I have a doubt.In jsp we can use<%@ include file="sample.js"%>.How do you do the same operation in Servlets

    hey,
    first of all i would think about getRequestDispatcher().include(request,response), but at least at tomcat it works with .jsp files only (even html files can't be included...).
    so i guess the only way out you have is the annoying
    out.print(all_your_js_code_here)...

  • Validation of variable groups

    hi any1 pls help...
    how do i validate a jsp form which has example "x" textboxes with same name of choice<%=i%> and when i increase "i" i have another group of choices with another set of same names called
    choice<%=i+1%>
    i try using the code below but it doesnt work
    var d=0;
    for(var d=0;d< <%=i%>; d++){
    for (var h= 0; h < document.example.choices(d+1).length; h++) {
    var val2 = eval("document.example.choices[h]" +(d+1) + ".value");
    if (val2 == ""){
    alert("please fill in all the blanks.");
    return false; }
    }

    Hi..
    Im having doubt in jsp & its urgent need for me..help out...
    Im having multiple html textbox of same name. Onclicking that textbox
    i have to call one JS page that creates calendar window which returns date
    to same textbox after selection.
    For single textbox, the values returns corretly..for multiple it doesnt return
    the value..coz of same name i think..
    Code:
    <script language="JavaScript" src="CmJavaScript.JS" ></script>
    <td class="table-text-tab"><input type=text name=a_date onClick=javascript:showcal('testForm.this.value'); value=<%=rs0.getString(5)%> size=13>
    <td class="table-text-tab"><input type=text name=f_date onClick=javascript:showcal('testForm.this.value'); value=<%=rs0.getString(7)%> size=13>
    Here showcal is the functionname & testform is the form name.
    here this two table data will be looped till the end of record selection.
    for example if i select 2 records in previous page..this code will be executed twice & will display textbox twice with same name..
    ie
    a_date ------------ f_date -----------
    a_date ------------ f_date -----------
    if i click first a_date textbox it populates calendar thru JS which returns date.
    bcoz of same textbox name..it doesnt returns the value...
    i mean its confused where to return whether in 1st (r) 2nd textbox?

  • Tracking Link click

    Hi everyone!
    I have one doubt in JSP....
    I am having one JSP page (say Home page) which consists various url links(with a href tag).
    After clicking on to any of the links I want to keep the record of which link was clicked(i.e. which JSP page is called)
    I want to test it on home page itself instead of going into each JSP page to check which JSP was called everytime when user click on the available url on Home page.
    In short I want to track which reference link was clicked on Home page itself.
    Thanks & Regards
    Ketan.

    hi
    thanks for the reply...
    but I am trying to avoid modifying each jsp...
    so what I have decided is to write a javascript function in the Home JSP page itself which will take the url as an argument and is called when clicked on any of the link. In that function I am calling a Servlet with query string consisting of corresponding url.The sevlet will take care of storing the url in to the database as well as redirecting to that page.
    I have to follow the MVC architecture, so cant include files in JSPs to achieve the same.Instead , I am calling a Servlet which will work as a Controller.
    Thanks & Regards,
    Ketan

  • JSP / HTML doubt ...

    Hi every one!
    My doubt may seem to be a waste doubt, but its a doubt,so..,
    Can we use JSP tags(like <%,<%=) in a servlet program.
    And can we use a JSP tag in between or inside a html tag as.,
    <a href=my.html name=<%=val%> >Hi</a> ,,where val is a string object holding some string say Hi.Can we use like this?
    Plz guide me! Thnkz in advance...

    Yes, like Yogesh mentioned it is possible to include a JSP expression
    <%=someVariable%> inside the value attribute of an HTML tag.
    However, there is a new and improved way of doing this. In case you are using the latest versions of everything - JSP 2.0 , Servlet 2.4 etc
    instead of using a JSP expression like this <%=someVariable%> , now you can do it in a much simpler syntax with EL like this ${someVariable}If you install JSTL 1.1 and configure it , there are much simpler and better ways to do things with JSPs now.
    For example this JSP scriptlet :
    <%
    for (int i=0; i < 10; i++){
        out.println(i);
    %>could be written in JSTL inside a JSP as
    <c:forEach begin="1" end="10" var="index" step="1">
        ${index} <br/>
    </c:forEach>The above is just a small example and doesn't show all the benefits of JSTL, but when the application grows large if one uses just JSP scriptlets and expressions the code becomes unmanageable.
    With JSTL the code looks much cleaner , simpler as it encapsulates all business logic to the business layer.
    If you are new to JSPs then you can get familiar with scriptlets and expressions, but I encourage you to make use of the benefits of JSTL after you become familiar with the basics of JSPs.
    Message was edited by:
    appy77

  • Can anyone clarify my doubt in a simple JSP Program ?

    when we write a simple jsp program such as helloworld.jsp does a
    class file or servlet be created when we run the jsp program using a
    web browser and Tomcat ? if so please tell the folder(path) in tomcat
    where this class file will be located or stored .Thankq

    JSPs will (usually) be compiled into class files representing Servlets, yes. But that's something that happens internally inside the application server and shouldn't concern you.
    Why would you need to know where it resides? It seems like a code smell if you need that information.
    If you're just curious, then look into the work directory of your tomcat.

  • JSP Include - Doubt

    Can i use dynamic value on the tag
    <%@jsp include page=dynamicValue/%>

    Why don't you just try it?

  • Doubt about equals on a jsp

    Hi all,
    I'm writing as I have this problem ....
    This simple JSP SHOULD print on the same page the user name if both his name and surname have been inserted in a form:
    <html>
    <head><title>Primo esempio di pagina jsp</title></head>
    <body>
    <br>
    <br>
    <form method="post">
    <input type="text" name="nome"> <input type="text" name="cognome">
    <input type="submit" value="invia">
    </form>
    String nomemio = (String)request.getParameter("nome");
    String cognomemio = (String)request.getParameter("cognome");
    <%if (!(nomemio.equals("")) && (!(cognomemio.equals("")))) {
    out.println("Benvenuto: "+request.getParameter("nome"));
    }%>
    </body>
    </html>
    The problem is this: Apache Tomcat (I use the version 5.5.12) throws lots of exceptions
    java.lang.NullPointerException
         org.apache.jsp.esFrancescoVerona_jsp._jspService(org.apache.jsp.esFrancescoVerona_jsp:59)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    NullPointerException at line 59 of the servlet generated by this jsp deals with the comparison between the strings nomemio and cognomemio against the empty strings (parameter of equals) !!!!
    How can I do to solve this problem?
    Thanks

    NullPointerException - what do you think this
    message means?????
    It's not a trick question!?
    <%
    String nomemio =
    = (String)request.getParameter("nome");
    String cognomemio =
    = (String)request.getParameter("cognome");
    if ( nomemio != null && cognomemio != null )
    <%= "Benvenuto: "+nomemio %>
    %>HTH.I tried even this but it displays Benvenuto (Welcome in Italian) even if I click on submit button without filling the cognome and nome fields

Maybe you are looking for

  • Hellp needed to resolve  Error

    Hi, While executing a package am getting the below error, on a function call inside a function, I have bolded the error line. Can any help me out to clear this, is that am doing anything wrong, please advice. Error : PLS-00201: identifier 'PRICE' mus

  • Adobe Flash Player Failure on PowerMac G5.  Please help!

    I have a PowerMac G5 computer, running OSX Version 10.4.11.  Up until yesterday, the computer performed flawlessly.  Suddenly, yesterday, I get a message from Firefox (the browser I usually use), telling me that my Flash Player had been disabled beca

  • Adobe photoshop CS 5 error 1

    Please send me a solution for ERROR 1

  • Reinstall iTunes after OS upgrade

    I upgraded to Snow Leopard and I am having trouble reinstalling my iTunes library from a backup

  • IPhone 5 got really wet

    My iPhone got very wet and had much condensation that was visibleon the front and back cameras. I put it into a a bag of rice for over 24 hours. Now, my phone has trouble booting up. The Apple logo keeps popping up in the middle of the screen, fade o