表不显示JSP

时间:2014-11-07 03:45:14

标签: jsp

我正在重复使用代码向jsp页面添加更多表格,但是使用表格设置时,4个单元格拒绝/给出错误显示。我如何让它工作,我做错了什么来显示信息 是的

Exception report

message An exception occurred processing JSP page /ViewStudentSchedule.jsp at line 77

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

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /ViewStudentSchedule.jsp at line 77

    74:                 <tr>
    75:                     <%--TABLE DISPLAY OF ACCOUNT INFORMATION  --%>
    76:                     <td colspan="2">Student: </td>
    77:                     <td colspan="2"><%= s1.getFirstName()%></td>
    78:                     <td colspan="2"><%= s1.getLastName()%></td>
    79:                     <td colspan="2"><%= s1.getStreet()%></td>
    80:                     <td colspan="2"><%= s1.getCity()%></td>


Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
root cause

java.lang.NullPointerException
    org.apache.jsp.ViewStudentSchedule_jsp._jspService(ViewStudentSchedule_jsp.java:138)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.3 logs.

上面的错误

<style>
                #image{
                    text-align: center;
                }
                #acctForm{
                    text-align: center;
                }
                #acctTable{
                    margin-left: 645px;
                }
                #submitTable{
                    margin-left: 755px;
                }
                table{
                    margin-left: auto;
                    margin-right: auto;
                }
                h4{
                    text-align: center;
                }
            </style>
    </head>
    <body>
        <%
            HttpSession ses1=request.getSession();
            Student s1= (Student)ses1.getAttribute("student");


            %>


        <div id = "image">
            <img src="StudentEarth.jpg" />
        </div>
        <h4>Here Is The Schedule</h4>
        <table border="1" width="75%" cellspacing="8" cellpadding="2">
            <thead>
                <tr>
                    <th colspan="18">Student Info</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                     <%--TABLE LABLES OF ACCOUNT INFORMATION  --%>
                    <td colspan="2"></td>
                    <td colspan="2">First Name</td>
                    <td colspan="2">Last Name</td>
                    <td colspan="2">Street</td>
                    <td colspan="2">City</td>
                    <td colspan="2">State</td>
                    <td colspan="2">Zip</td>
                    <td colspan="2">Email</td>
                    <td colspan="2">Gpa</td>
                </tr>
                <tr>
                    <%--TABLE DISPLAY OF ACCOUNT INFORMATION  --%>
                    <td colspan="2">Student: </td>
                    <td colspan="2"><%= s1.getFirstName()%></td>
                    <td colspan="2"><%= s1.getLastName()%></td>
                    <td colspan="2"><%= s1.getStreet()%></td>
                    <td colspan="2"><%= s1.getCity()%></td>
                    <td colspan="2"><%= s1.getState()%></td>
                    <td colspan="2"><%= s1.getZip()%></td>
                    <td colspan="2"><%= s1.getEMail()%></td>
                    <td colspan="2"><%= s1.getGpa()%></td>

                </tr>



            </tbody>
        </table>
                <table width="50%" cellspacing="8" cellpadding="2">


        </table>  

    </body>
</html>

0 个答案:

没有答案