Menu

Problem with something? Database connection?

Help
mkhines
2006-01-29
2012-10-09
  • mkhines

    mkhines - 2006-01-29

    This is my JSP file

    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ include file="Connections/ai.jsp" %>
    <%@ include file="inc/header.jsp" %>
    <%
    Driver DriverRecordset1 = (Driver)Class.forName(MM_ai_DRIVER).newInstance();
    Connection ConnRecordset1 = DriverManager.getConnection(MM_ai_STRING,MM_ai_USERNAME,MM_ai_PASSWORD);
    PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("SELECT * FROM dbo.L_PERSONS");
    ResultSet Recordset1 = StatementRecordset1.executeQuery();
    boolean Recordset1_isEmpty = !Recordset1.next();
    boolean Recordset1_hasData = !Recordset1_isEmpty;
    Object Recordset1_data;
    int Recordset1_numRows = 0;
    %>
    <%
    int Repeat1__numRows = -1;
    int Repeat1__index = 0;
    Recordset1_numRows += Repeat1__numRows;
    %>
    <display:table id="<%=pageContext.getAttribute("PERSONID")%>">
    <% while ((Recordset1_hasData)&&(Repeat1__numRows-- != 0)) { %>
    <display:column><%pageContext.getAttribute("FIRSTNAME")%></display:column>
    <display:column><%pageContext.getAttribute("LASTNAME")%></display:column>
    <%
    Repeat1__index++;
    Recordset1_hasData = Recordset1.next();
    }
    %>
    <display:column media="csv excel"/>
    <display:setProperty name="export.pdf" value="true" />
    </display:table>

    And when I run the file, I get this error (It appears to be talking about something in the class/java file, and not my file - I have no idea.

    HTTP Status 500 -

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: Unable to compile class for JSP

    Generated servlet error:
    D:\Tomcat5028\work\Catalina\localhost\ai\org\apache\jsp\example_002dexport_jsp.java:185: ';' expected
    int evalDoAfterBody = _jspx_th_display_column_0.doAfterBody();
    ^

    Generated servlet error:
    D:\Tomcat5028\work\Catalina\localhost\ai\org\apache\jsp\example_002dexport_jsp.java:210: ';' expected
    int evalDoAfterBody = _jspx_th_display_column_1.doAfterBody();
    ^
    2 errors

    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
    org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    

    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
    Apache Tomcat/5.0.28

    The base example-export.jsp file which came with the war worked just fine. Does anyone see my issue?

     
    • tholin

      tholin - 2006-02-04

      Hi,

      it seems that your have an sytax error in your class
      file. maybe you have an unnclosing statement (semicolon expected).

      regards, tholin

       

Log in to post a comment.

MongoDB Logo MongoDB