Error in my jsp code

<%@ page language = "java" import = "java.sql.*" %>
<%@ page import = "java.sql.*" %>
<%@ page import = "java.text.*" %>
<%
//String stin,btin,pname,pcount,tax;
String stin=request.getParameter("sellertin");
session.setAttribute("sellertin",stin);
String btin=request.getParameter("buyertin");
session.setAttribute("buyertin",btin);
String pname=request.getParameter("prodname");
session.setAttribute("prodname",pname);
String pcount=request.getParameter("prodcount");
session.setAttribute("prodcount",pcount);
String tax=request.getParameter("vat");
session.setAttribute("vat",tax);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String st = "jdbc:odbc:loginval";
Connection cn = DriverManager.getConnection(st," "," ");
Statement stmt = cn.createStatement();
stin=stin+"prod";
String str = "select * from '"+stin+"' where proname='"+pname+"'" ;
ResultSet result1 = stmt.executeQuery(str);
String pron,prop,proc;
pron = result1.getString("proname");
prop = result1.getString("proprice");
proc = result1.getString("procount");
int rate,price,ntax,net,ncount;
price=Integer.parseInt(prop);
ntax=Integer.parseInt(tax);
rate=price+(price*(ntax/100));
ncount=Integer.parseInt(pcount);
net=rate*ncount;
%>
the tax is calculated as<%=net%>in this code i am trying to dynamically select different tables based on the user input. nut the program does not execute properly.
i get an error as follows
syntax error in query:incomplete query clause.
some one plz find where i ve gone wrong.
thanks in advance

String str = "select * from '"+stin+"' where proname='"+pname+"'" ;
ResultSet result1 = stmt.executeQuery(str);
String pron,prop,proc;
pron = result1.getString("proname");
prop = result1.getString("proprice");
proc = result1.getString("procount");You can not just access the result set like that you need to call the next method.
    ResultSet result1 = stmt.executeQuery(str);
    String pron,prop,proc;
    if (result1.next()) {
        pron = result1.getString("proname");
        prop = result1.getString("proprice");
        proc = result1.getString("procount");
    }

Similar Messages

  • 500 error with no JSP code

    I'm using Orion as my server. I've got an app with a couple of JSP's. One JSP is welcome.jsp and runs JSP code fine. The other is navigation.jsp and it doesn't have ANY JSP code at all, but it still produces an internal 500 error when I browse to it....
    Any suggestions?

    A 500 error code usually indicates that there was some problem with the server itself. For example, Tomcat will report 500 if it is unable to find the Java compiler it needs.
    I'm not at all familiar with Orion, and never heard of it before today, but you may want to see if they included some sample JSP code, and if so, test to see if that code works. You might also double check that you've followed all of the instructions they set forth. In particular, pay attention to where to find error messages (usually in a log file).
    One potential gotcha that seems to plague lots of developers is spaces in file names. If you installed Orion in something other than the default directory, and your preferred directory has a space somewhere in the path name, it's possible that the Orion developers didn't take that into account and as a result, some of their stuff works correctly and some doesn't.

  • Error While running the JSP Code

    This is the error message:
    A java exception has occurred during the processing of this request.
    Error occurred in JSP element starting at line number 20
    javax.servlet.jsp.JspTagException: I/O Error: java.net.SocketException: Connection reset
         at desisoft.jsp.tagext.SendMail.doAfterBody(SendMail.java:213)
         at desisoft_jsp_SendMail_jsp1139292195218._jspService(desisoft_jsp_SendMail_jsp1139292195218.java:111)
         at desisoft.server.JspBaseClass.service(JspBaseClass.java:48)
    The JSP code:
    <%@ taglib prefix="blx" uri="/blx.tld" %>
    <HTML>
    <BODY>
    <%
    // Get username.
    String email = request.getParameter( "email" );
    %>
    <% if ( email == null || email.equals( "" )) { %>
    Please enter an email address.
    <% } else { %>
    <blx:email host="mail.xxx.com" from="[email protected]">
    <blx:emailTo><%= email %></blx:emailTo>
    Thank you for registering with us. You registered the
    following name: <%= request.getParameter( "username" ) %>
    Your registration was received at <%= new java.util.Date() %>
    Attached, please find a contents file.
    </blx:email>
    <!-- Also write out some HTML -->
    Thank you. A confirmation email has been sent to <%= email %>
    <% } %>
    </BODY>
    </HTML>

    This is the error message:
    A java exception has occurred during the processing of this request.
    Error occurred in JSP element starting at line number 20
    javax.servlet.jsp.JspTagException: I/O Error: java.net.SocketException: Connection reset
         at desisoft.jsp.tagext.SendMail.doAfterBody(SendMail.java:213)
         at desisoft_jsp_SendMail_jsp1139292195218._jspService(desisoft_jsp_SendMail_jsp1139292195218.java:111)
         at desisoft.server.JspBaseClass.service(JspBaseClass.java:48)
    The JSP code:
    <%@ taglib prefix="blx" uri="/blx.tld" %>
    <HTML>
    <BODY>
    <%
    // Get username.
    String email = request.getParameter( "email" );
    %>
    <% if ( email == null || email.equals( "" )) { %>
    Please enter an email address.
    <% } else { %>
    <blx:email host="mail.xxx.com" from="[email protected]">
    <blx:emailTo><%= email %></blx:emailTo>
    Thank you for registering with us. You registered the
    following name: <%= request.getParameter( "username" ) %>
    Your registration was received at <%= new java.util.Date() %>
    Attached, please find a contents file.
    </blx:email>
    <!-- Also write out some HTML -->
    Thank you. A confirmation email has been sent to <%= email %>
    <% } %>
    </BODY>
    </HTML>

  • ERROR!!! ~JSP CODES~

    Any problem with the following jsp code?
    <%@ page import="
    java.io.*,
    java.util.*"
    %>
    <%
    boolean login_ok = false;
    Boolean result_obj = new Boolean(login_ok);
    result_obj = (Boolean)request.getAttribute("result");
    login_ok = result_obj.booleanValue();
    %>
    <html>
    <head>
    <title>Login results page</title>
    </head>
    <body>
    <%
    if (login_ok){
    %>
    <p>Login Successful!</p>
    <%
    else{
    %>
    <p>Login Failure!</p>
    <%
    %>
    </body>
    </html>
    It returns the following error:
    Exception in jsp: null
    java.lang.NullPointerException
         at _0005ctest_0002ejsptest_jsp_3._jspService(_0005ctest_0002ejsptest_jsp_3.java:71)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:868)
         at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)
         at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:255)
         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:360)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:868)
         at com.gefionsoftware.server.ServletContextImpl$ServletHandler.call(ServletContextImpl.java)
         at com.gefionsoftware.server.ServletContextImpl.executeServlet(ServletContextImpl.java)
         at com.gefionsoftware.server.ServletContextImpl.execute(ServletContextImpl.java)
         at com.gefionsoftware.server.GenericServer.execute(GenericServer.java)
         at com.gefionsoftware.server.lws.LiteWebServer$RequestHandler.run(LiteWebServer.java)
         at se.pureit.util.ThreadPool$WorkThread.startRunnable(ThreadPool.java)
         at se.pureit.util.ThreadPool$WorkThread.run(ThreadPool.java)

    Hope you are getting a null-pointer exception here :
    result_obj = (Boolean)request.getAttribute("result");
    login_ok = result_obj.booleanValue();
    Make sure that the request attribute value is not null.
    Hope this helps
    Santhosh

  • 500 Internal Server Error while connecting JSP with Oracle

    Hello Friends,
    We Have installed Oracle Applications 11i in our orgaization which run on HP-UX 11.11 (HP Unix). I have created a JSP file in which I am trying to connect the database using OracleConnectionCacheImpl Class File in oracle.jdbc.pool directory. But it shows an error message as:
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    I have also installed Oracle HTTP Server on my personal machine at which this code runs perfectly only the error comes when i try to connect oracle from Oracle HTTP Server installed on our HP Unix Server.
    the path for pool package is:
    /appltest/apps/prodora/iAS/oem_webstage/oracle/jdbc/pool
    the location of JSP file is:
    /appltest/apps/prodcomn/portal/TEST_test/test
    What I think is I have to play with the CLASSPATh entries, but dont know how. Please help me in solving this issue...
    For your reference the JSP code is:
    <%@ page import="java.sql.*, javax.sql.*, oracle.jdbc.pool.*" %>
    <jsp:useBean id="ods" class="oracle.jdbc.pool.OracleConnectionCacheImpl" scope="session" />
    <%
    try
    ods.setURL("jdbc:oracle:thin:@test:1546:test");
    ods.setUser("kpm_hr");
    ods.setPassword("kpm_hr");
    Connection conn = ods.getConnection();
    Statement stmt = conn.createStatement();
    Resultset rset = stmt.executeQuery("select first_name,last_name from kpm_hr.kpm_hr_emp_mst where empcode='P0580'");
    rset.next();
    out.println(rset.getString(1)+" "+rset.getString(2);
    catch(SQLException e)
    out.println(e);
    } Thanks in adavnce,
    Ankur

    Just to verify, which relevant log files have you found?
    catch(SQLException e) {
    out.println(e);
    } Have you search the console log file?
    A quick observation reveals that your jsp is just a standalone java program executed inside jsp. Suppose you just run it as a standalone program. Any error then?
    Another way going forward is to install oc4j standalone of the same version. It is very easy to install: just download the oc4j-extended.zip and unzip it and run "java -jar oc4j.jar". Put you jsp inside j2ee/home/default-web-app and run. You should see relevant log messages in j2ee/home/log/server.log and j2ee/home/application-deployments/yourApp/application.log.
    You should have Jdeveloper of some appropriate version installed. If you have not, install one. It might be not a little bit high learning curve at first, but the rewards are quick and amazing, especially since jdev 10.1.3. (I am speaking from my experience.) Try it with Jdeveloper.

  • Error while parsing JSP with WebLogic 5.1/SP9/JDK 1.2.2

    Hello everybody,
              I get the error given below when calling a JSP in a WebLogic
              application which seems to work fine in all other (non-JSP) parts:
              java.lang.NullPointerException:
                   at weblogic.servlet.jsp.JspLexer.addSetPropertyValue(JspLexer.java:1432)
                   at weblogic.servlet.jsp.JspLexer.mXML_SET_PROPERTY(JspLexer.java,
              Compiled Code)
                   at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1726)
                   at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java, Compiled Code)
                   at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled
              Code)
                   at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
                   at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled Code)
                   at weblogic.servlet.jsp.JspParser.parse(JspParser.java:159)
                   at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:109)
                   at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java,
              Compiled Code)
                   at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
              Code)
                   at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
                   at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
                   at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
                   at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
                   at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
                   at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
                   at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              Code)
              I know that this error has been reported more than once in these
              discussion groups, and all people who solved it say
              - that it occurs only wen running WebLogic 5.1 with JDK 1.3 instead of
              1.2.2
              - that it may also be caused by bad jsp code
              But in my case, it has to be another reason, because
              - I am using jdk 1.2.2
              - the same JSP file is running withour errors on WebLogic 6
              I wonder if it could have something to do with the operating system:
              the parsing error is produced on a Windows version of WL 5.1, while my
              WL 6 which doesn't cause errors is running with Linux.
              Many thanks in advance for any help,
              Eckhard Beisswenger
              

    Once again me!
              After a long time, I stumbled by accident across the answer that solves the problem I described above. It is explained at
              http://support.bea.com/application;JSESSIONID_WLCS_DEFAULT=2R2lzQfEBxFRMX2z0AxeU1Un3N1522I9fCIUI7GfjnjsiSYkPscz
              The clue is that weblogic complains about corresponding get and set methods, when the type of the set methods parameter is different from the return type of the corresponding get method. Unfortunately, the weblogic lexer class gives only a NullPointerException without any hint.
              

  • Is there a way of embedding JSP code in VBScript?

    I am launching MS Excel using VBScript in the JSP Page. I want to populate the spread sheet with the values coming from a Java Bean. I am not sure how I can embed JSP code in VBScript.
    Thanks

    I tried doing that with Javascript but it gives me error..
    here is the code I was testing..
    <script language="JavaScript">
    function test(){
    var name = <%=(bean.getName())%>;
    alert(name);
    </script>
    <input type="button" name="Button" value="test" onClick=javascript:test()>
    Error : Object Expected
    If I do a similar thing with VBScript, it doesnt work either.
    here is the test code for VBScript
    <SCRIPT LANGUAGE="VBScript">
    sub button1_onclick()
         dim name = <%=(bean.getName())%>
    ' Launch Excel
    dim app
    set app = createobject("Excel.Application")
    ' Make it visible
    app.Visible = true
    set rng2 = wb.Activesheet.Range("A1").Resize(2,2)
    rng2.value = name
    ' Give the user control of Excel
    app.UserControl = true
    end sub
    </SCRIPT>

  • Internal Server Error while running JSP file (Oracle AS - HP Unix)

    Hello Friends,
    I have created a JSP file in which I am trying to connect the database using oracle.jdbc.pool directory. But it shows an error message as:
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    the path for pool package is:
    /appltest/apps/prodora/iAS/oem_webstage/oracle/jdbc/pool
    the location of JSP file is:
    /appltest/apps/prodcomn/portal/TEST_test/test
    What I think is I have to play with the CLASSPATh entries, but dont know how. Please help me in solving this issue...
    For your reference the JSP code is:
    <%@ page import="java.sql.*, javax.sql.*, oracle.jdbc.pool.*" %>
    <jsp:useBean id="ods" class="oracle.jdbc.pool.OracleConnectionCacheImpl" scope="session" />
    <%
    try
    ods.setURL("jdbc:oracle:thin:@test:1546:test");
    ods.setUser("kpm_hr");
    ods.setPassword("kpm_hr");
    Connection conn = ods.getConnection();
    Statement stmt = conn.createStatement();
    Resultset rset = stmt.executeQuery("select first_name,last_name from kpm_hr.kpm_hr_emp_mst where empcode='P0580'");
    rset.next();
    out.println(rset.getString(1)+" "+rset.getString(2);
    catch(SQLException e)
    out.println(e);
    Thanks in adavnce,
    Ankur
    Regards,
    Ankur Bhatia

    Just to verify, which relevant log files have you found?
    catch(SQLException e) {
    out.println(e);
    } Have you search the console log file?
    A quick observation reveals that your jsp is just a standalone java program executed inside jsp. Suppose you just run it as a standalone program. Any error then?
    Another way going forward is to install oc4j standalone of the same version. It is very easy to install: just download the oc4j-extended.zip and unzip it and run "java -jar oc4j.jar". Put you jsp inside j2ee/home/default-web-app and run. You should see relevant log messages in j2ee/home/log/server.log and j2ee/home/application-deployments/yourApp/application.log.
    You should have Jdeveloper of some appropriate version installed. If you have not, install one. It might be not a little bit high learning curve at first, but the rewards are quick and amazing, especially since jdev 10.1.3. (I am speaking from my experience.) Try it with Jdeveloper.

  • Error on deploying JSP web module

    Hi,
    I've created a JSP web module that consumes a web service. I'm following this tutorial
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0cf9e42-ccb0-2c10-d0a4-f5aa8a79e19a?quicklink=index&overridelayout=true|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0cf9e42-ccb0-2c10-d0a4-f5aa8a79e19a?quicklink=index&overridelayout=true]
    But when I deploy my ear project, I had this error
    Application error occurred during the request procession.
    Details:   com.sap.engine.services.servlets_jsp.server.exceptions.WebIOException:
    Error compiling [/sample.jsp] of alias [LocalDevelopmentdc_webmodulesap.com] of J2EE application [sap.com/dc_webmoduleear].
    Exception id: [001CC43ABAC00086000056FB00006CEA0004A5A7E1A64FD3]
    Here's the java code in the JSP:
    InitialContext ctx = new InitialContext();
    WS_Preview obj = (WS_Preview).ctx.lookup("java:comp/env/newproxy");
    WS_PreviewViDocument port = (WS_PreviewViDocument)obj.getLogicalPort("Config1Port_Document",WS_PreviewViDocument.class);
    GetElementXHTMLValueResponse result = new GetElementXHTMLValueResponse();
    result = port.GetElementXHTMLValue("A","A","A");
    out.print(result);
    Does anyone know how to solve this error? Thanks

    Because you do not have an infrastructure database, you will not be able to deploy your web service from OEM as one of its steps is to register the service in the UDDI registy - the Web service deployment and UDDI registration are tied tightly together in OEM right now.
    All is not lost, however. You have two routes to deploy the Web Service on Oracle9iAS:
    1. Use DCM, which is the command line interface to deploy applications/webservices/wars/ears on Oracle9iAS. It does not have the dependency on UDDI.
    To deploy a Web service using DCM, say your Web service ear file were named test.ear your deployment command would look something like:
    c:\oracle\ora903\dcm\bin\dcmctl deployApplication -file test.ear
    See the doc for much more detail to let you tailor DCM to do all the stuff that is available through EM or specific to your application:
    http://download-west.oracle.com/docs/cd/A97329_03/core.902/a92171/dcm.htm#643834
    2. In JDeveloper 9.0.3, there is a DCM Servlet that lets you do remote deployment to Oracle9iAS:
    http://otn.oracle.com/products/jdev/htdocs/readme_9031.html#viadcm
    I suspect your deployment problem from Oracle9i JDeveloper may be (this may be an incorrect assumption) due to trying to use a connection that is setup as if Oracle9iAS is a standalone OC4J.
    Mike.

  • Stupid Error in Compiling JSP on Tomcat 4.1

    Hi,
    I know I am missing something stupid, but I am not able to compile/view a simple JSP.
    The code of the JSP is
    <%@ page language="java" import="builder.*" errorPage="" %>
    <html>
    <%builder.MenuBuilder menuBuilder = new builder.MenuBuilder("http://amitabh.pic.com.kw/navmenu.xml", out, "\t\t\t");%>
    <head><body>
    <%menuBuilder.generateHTML();%>
    ..And I am getting the following error
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac] E:\ApacheGroup\Tomcat4.1 \work\Standalone\localhost\aktest\NavTable_jsp.java:7: package builder does not exist
    [javac] import builder.*;
    [javac] ^
    [javac] E:\ApacheGroup\Tomcat4.1\work\Standalone\localhost\aktest\NavTable_jsp.java:54: package builder does not exist
    [javac]     builder.MenuBuilder menuBuilder = new builder.MenuBuilder("http://amitabh.pic.com.kw/navmenu.xml", out, "\t\t\t");
    [javac] ^
    [javac] E:\ApacheGroup\Tomcat4.1\work\Standalone\localhost\aktest\NavTable_jsp.java:54: package builder does not exist
    [javac]     builder.MenuBuilder menuBuilder = new builder.MenuBuilder("http://amitabh.pic.com.kw/navmenu.xml", out, "\t\t\t"); [javac] ^
    [javac] 3 errors
    The above mention code are the only JSP script on the page.
    I have package builder defined under WEB-INF\classes and the class MenuBuilder and all related classes are in the pacakge and are compiled.
    I am using Tomcat 4.1.24 running on JDK 1.4.1 (build 1.4.1_02-b06).
    Other JSP pages in the same context which does not reffer any class under WEB-INF\classes are being displayed so are pages under examples context.
    Can anybody help me out on what i am missing.
    Thanks in advance
    Amitabh

    Hi,
    AFAIK, builer package shoud be under WEB-INF\classes directory or the context. It is under that direcory.
    As far as adding the package to system classpath or Tomcat classpath, I dont want to do that as it would contaminate the classpath of other applications/contexts.
    The applications server is supposed to automatically add WEB-INF\classes into the classpath of the context. And its working for other context.
    There has to be other solution.
    Regards
    Amitabh

  • How to use protected method in jsp code

    Could anyone tell me how to use protected method in jsp code ...
    I declare a Calendar class , and I want to use the isTimeSet method ,
    But if I write the code as follows ..
    ========================================================
    <%
    Calendar create_date = Calendar.getInstance();
    if (create_date.isTimeSet) System.out.println("true");
    %>
    ============================================================
    when I run this jsp , it appears the error wirtten "isTimeSet has protected access in java.util.Calendar"

    The only way to access a protected variable is to subclass.
    MyCalendar extends Calendar
    but I doubt you need to do this. If you only want to tell if a Calendar object has a time associated with it, try using
    cal.isSet( Calendar.HOUR );

  • Error in precompiling JSPs using OJSPC

    Hi,
    I am precompiling JSPs in war file using ojspc as specified below.
         ojspc -output myapp.war app.war
    However I am getting following error:
    Detected archive, now processing contents of app.war...
    Setting up temp area...
    Expanding archive in temp area...
    WARNING: IGNORED file: /WEB-INF/lib/jsf-impl.jar
    WARNING: IGNORED file: /WEB-INF/lib/jsf-ri.jar
    Parse error in AddNewAttachment.jsp:
    oracle.jsp.parse.JspParseException: /AddNewAttachment.jsp: Line # 48,
    actionListener="#{addAttachmentBackingBean.cancel}"/>
    Error: A String literal value, "#{addAttachmentBackingBean.cancel}", has been pr
    ovided for attribute actionListener which has an associated deferred method with
    void signature
    Removing temp area...
    Can anbody help me to solve this problem?
    Thanks.
    Regards,
    Umesh

    Hi,
    If I create a method via the binding editor in JDev it creates a managed bean method with a void return type as default.
    eg.
        public void cmdlink_actionListener(ActionEvent actionEvent) {
            // Add event code here...
        }could it have anything to do with the two OJSPC warnings? jsf-impl.jar should be included in your war file. I haven't seen this warning when OJSPC is compiling.
    Brenden

  • Error on token(jsp error)

    Hi i am writing a code in which i have to call one jsp page from another but as soon as the control gets transferred i get the error msg as:
    Syntax error on token(s), misplaced construct(s)
    16: if(rs.next()==false)
    17: {
    18:
    19: <jsp:forward page="success.jsp"/>
    20:
    21: }
    22: %>
    An error occurred at line: 19 in the jsp file: /second/process.jsp
    Syntax error, insert "AssignmentOperator Expression" to complete Assignment
    16: if(rs.next()==false)
    17: {
    18:
    19: <jsp:forward page="success.jsp"/>
    20:
    21: }
    22: %>
    An error occurred at line: 19 in the jsp file: /second/process.jsp
    Syntax error, insert ";" to complete Statement
    16: if(rs.next()==false)
    17: {
    18:
    19: <jsp:forward page="success.jsp"/>
    20:
    21: }
    22: %>
    An error occurred at line: 19 in the jsp file: /second/process.jsp
    forward cannot be resolved
    16: if(rs.next()==false)
    17: {
    18:
    19: <jsp:forward page="success.jsp"/>
    20:
    21: }
    22: %>
    An error occurred at line: 19 in the jsp file: /second/process.jsp
    The operator / is undefined for the argument type(s) String, void
    16: if(rs.next()==false)
    17: {
    18:
    19: <jsp:forward page="success.jsp"/>
    20:
    21: }
    22: %>
    An error occurred at line: 19 in the jsp file: /second/process.jsp
    Syntax error on tokens, delete these tokens
    16: if(rs.next()==false)
    17: {
    18:
    19: <jsp:forward page="success.jsp"/>
    20:
    21: }
    22: %>
    An error occurred at line: 22 in the jsp file: /second/process.jsp
    Syntax error, insert "}" to complete Statement
    19: <jsp:forward page="success.jsp"/>
    20:
    21: }
    22: %>
    23:
    24: <%
    25: else
    An error occurred at line: 31 in the jsp file: /second/process.jsp
    Syntax error, insert "Finally" to complete TryStatement
    28: <jsp:forward page="fail.jsp"/>
    29: <%
    30: }
    31: }
    32: %>
    33: <%catch(Exception e)
    34: {
    An error occurred at line: 32 in the jsp file: /second/process.jsp
    Syntax error, insert "}" to complete Block
    29: <%
    30: }
    31: }
    32: %>
    33: <%catch(Exception e)
    34: {
    35:
    I am using MS-ACCESS AS DATABASE.
    the jsp code is:
    {color:#ff0000}<%@ page contentType="text/html; charset=UTF-8"%>
    <%@ page import="java.io.{color}{color:#ff0000}*"%>*
    *<%@ page import = "java.sql.*"%>
    <%
    String account=request.getParameter("ac");
    String password=request.getParameter("pass");
    String url="Jdbc:Odbc:Namrata";
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection(url);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery("select from database1 where Account="+account+"and Password="+password);
    if(rs.next()==false)
    <jsp:forward page="success.jsp"/>
    %>
    <%
    else
    %>
    <jsp:forward page="fail.jsp"/>
    <%
    %>
    <%catch(Exception e)
    out.println("the exception is:"+e);
    %>{color}

    Namrata.Kakkar wrote:
    but i have google searched and came to know that in jsp whatever java code we have to write we will write in tagsThat was not very good advice. Like I said, get Sun's Java EE tutorial (it's free) and learn how to do it the correct way.

  • Error while using Jsp Beans

    Hi, i just have written my first bean but i'm getting this erro message:
    java.lang.ClassNotFoundException: Unable to load class userinfo.FormBean
    Can somebody pls help me out.
    Thanks in advance
    JBP
    Below are my codes for the bean and my jsp codes
    Bean:
    package userinfo;
    import java.io.*;
    public class FormBean implements Serializable
    private String name;
    private String email;
    public FormBean()
    name = "test";
    email = "test";
    public void setName(String name)
    this.name = name;
    public String getName()
    return name;
    public void setEmail(String email)
    this.email = email;
    public String getEmail()
    return email;
    Jsp Codes:
    <html>
    <head>
    <title>Login</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <jsp:useBean id="formbean" class="userinfo.FormBean"/>
    <jsp:setProperty name="formbean" property="*" />
    <body bgcolor="#FFFFFF" text="#000000">
    <% if (request.getParameter("name")==null
    && request.getParameter("email"==null)
    { %>
    <form name="form1" method="post" action="process.jsp">
    Name:
    <input type="text" name="textfield">
    <br>
    <br>
    Email:
    <input type="text" name="textfield2">
    <br>
    <br>
    <input type="submit" name="Submit" value="Process">
    </form>
    <% } else {%>
    <p>
    <b>you have provided the following info</b>
    <p>
    <b>Name</b>:<jsp:getProperty name="formbean" property="name"/>
    <p>
    <b>Email</b>:<jsp:getProperty name="formbean" property="email"/>
    <p>
    <%}%>
    </body>
    </html>

    Hi!
    I tried ur bean in my program on javawebserver.
    It didn't work.
    gave error:
    java.lang.ClassNotFoundException: Unable to load class userinfo.FormBean
    then I just added
    import java.io.Serializable;
    in ur bean and tried.
    It gave me error:
    D:\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_examples\_jsp\_samples\_Brand__new\_mail1.java:19: '}' expected.
    static char[][] jspxhtml_data = null;
    I think the problem with bean is solved.
    U check for the same.
    check the settings of server and classpath .
    write whether it works,
    bye,
    Samir

  • Generating error page(in jsp) when session expires....

    hello,
    i want to generate error page(in jsp) when session get expires...
    plz help me out.............

    You could do it according to the line BalusC supplied in another topic:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=login.jsp">The only thing you gotta change, is the URL, make it:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=error.jsp">Create 'error.jsp' and have the message 'Session expired, sorry!' or something printed. If you want to use error.jsp for more than just the session expiration, add a parameter to it:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=error.jsp?error=sessionexpired"> Place the following lines in your error.jsp:
    String errormessage = request.getParameter("error");
    if(errormessage.equals("sessionexpired")){
    out.println("Your session has expired, sorry!");
    }else if(errormessage.equals("whatever")){
    // To do code here.
    }

Maybe you are looking for

  • I have a new i-phone 5s , i want printable instructions on how to use it

    i have a new 5s i-phone , i need printable instructions on how to use it , such as adding to my contacts and icon diplay

  • Parametrized query with output from sql

    Hey all, has anyone figure out how to use the database connectivity toolset to perform a parameterized query with outputs (SQL)? From the other threads that i have read it would seem that this issue is not resolved. The error i get is: Error -2147467

  • Problem Running Hello.java

    Hi All, I am facing problem to run Hello.java. The following exception accurs when I try to run it. java.lang.RuntimeException: RegOpenKeyEx: The system cannot find the file specified. (2)      at com.ibm.speech.recognition.RecoImpl.initialize(Native

  • Pointing to new Home Page

    I've created a new home page for my site (www.shigmurao.org) and have changed the internal links to point to the new home page. But if you type in the URL for the site you still get the old home page. How do I indicate that visitors should be directe

  • Install SBO 2007 in laptop, how to get continuous license?

    I installed SBO 2007 in my laptop for learning purposes. The software has 30-day limit, but I still need more time to master it. Is there anyway to remove 30day limit or get continous license w/o fee / low fee?