及啊!!有问题啦
发表在JavaWeb图书答疑
2009-05-17
是否精华
是
否
版块置顶:
是
否
[font size=2][font face=楷体_GB2312][font color=#FF0000][strong]程序代码如下:[/strong]
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<%@page import="form.ConsumerForm"%>
<%
ConsumerForm consumerFormPT=(ConsumerForm)session.getAttribute("form");
%>
<body>
<%if(consumerFormPT.getManageLevel().equals("普通")){%>
<table width="366" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#F1BD36">
<tr bgcolor="#FFFFFF">
<td width="171" height="20">用户名:<%=consumerFormPT.getAccount()%></td>
<td width="195" height="20">姓名:<%=consumerFormPT.getName()%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">性别:<%=consumerFormPT.getSex()%></td>
<td height="20">QQ号码:<%=consumerFormPT.getQQNumber()%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">主页:<%=consumerFormPT.getMainPage()%></td>
<td height="20">兴趣:<%=consumerFormPT.getInterest()%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">邮箱:<%=consumerFormPT.getEMail()%></td>
<td height="20" bgcolor="#F1BD36"><a href="head_consumerUpdate.jsp">更改用户信息</a></td>
</tr>
</table>
<%} %>
</body>
</html>
[/font][/font][/font]
[font size=2][font face=楷体_GB2312][font color=#FF0000][strong]程序出错代码如下:[/strong]
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.head_005fConsumer_jsp._jspService(head_005fConsumer_jsp.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<%@page import="form.ConsumerForm"%>
<%
ConsumerForm consumerFormPT=(ConsumerForm)session.getAttribute("form");
%>
<body>
<%if(consumerFormPT.getManageLevel().equals("普通")){%>
<table width="366" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#F1BD36">
<tr bgcolor="#FFFFFF">
<td width="171" height="20">用户名:<%=consumerFormPT.getAccount()%></td>
<td width="195" height="20">姓名:<%=consumerFormPT.getName()%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">性别:<%=consumerFormPT.getSex()%></td>
<td height="20">QQ号码:<%=consumerFormPT.getQQNumber()%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">主页:<%=consumerFormPT.getMainPage()%></td>
<td height="20">兴趣:<%=consumerFormPT.getInterest()%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20">邮箱:<%=consumerFormPT.getEMail()%></td>
<td height="20" bgcolor="#F1BD36"><a href="head_consumerUpdate.jsp">更改用户信息</a></td>
</tr>
</table>
<%} %>
</body>
</html>
[/font][/font][/font]
[font size=2][font face=楷体_GB2312][font color=#FF0000][strong]程序出错代码如下:[/strong]
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.head_005fConsumer_jsp._jspService(head_005fConsumer_jsp.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)