日期:2014-05-18  浏览次数:20725 次

JSP编译出错,请大家帮帮忙,本人是菜鸟
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
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
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)


root   cause  

java.lang.NullPointerException
soccertable.BlobBean.readBlob(BlobBean.java:155)
org.apache.jsp.categoryshow_jsp._jspService(categoryshow_jsp.java:107)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
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

------解决方案--------------------
从内置对象request中获得变量值为空,但是在后面代码中有通过此变量获得此变量的属性。如果变量为空,当获得空值的属性就会报空指针异常
如:String aaa=request.getParameter( "*** ");
String类型的aaa获得后是空值
如果后面代码想从aaa执行一些操作时就会报错(如:aaa.split( "- ");)
因为是空值,空值没有任何属性。
这样报错异常为空指针异常。

大多空指针异常也是由于这样的失误造成,解决办法:判断是否为空然后进行操作。

我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html