jsp简单问题急啊!!!!!!
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.handle
JspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException goods.opendb.executeQuery(opendb.java:29)
org.apache.jsp.goods.goodsInfo_jsp._jspService(goodsInfo_jsp.java:185)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.16 logs.
------解决方案--------------------空指针异常呀,都行判断把null转为空串 " "
------解决方案--------------------java.lang.
NullPointerException goods.opendb.executeQuery(opendb.java:29)
-------------------------------------------------------
把opendb.java文件里面29行附近的代码贴出来看看呢
------解决方案--------------------注意判断 null
null == var1 || " ".equals(var1)
------解决方案--------------------空指针异常
在楼上这段代码中,可能出现取出空值的应该只有request.getParameter()
所以应该是request中没有名为userid或password的属性,所以取出为空.再用空值再点一个getBytes()方法,就出现了空指针异常
我一直认为空指针异常是JSP开发中最常见的异常,呵呵
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html