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

高分求救的白痴问题
刚开始接触JSP,却要搞定一台重装的机器,需要将JSP配置好,现在搞不定了。

<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=utf-8 ">
<%@   page   contentType= "text/html;charset=utf-8 "%>  
<jsp:useBean   id= "DBbean "   scope= "page "   class= "Datebase.DatabaseBean "/>
<jsp:useBean   id= "SQLbean "   scope= "page "   class= "Datebase.RunSql "/>
<%@   page   language= "java "   import= "java.net.* "   %>
<%@   page   language= "java "   import= "java.sql.* "   %>

会报这样的错误
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.handleJspException(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
Datebase.DatabaseBean.executeQuery(DatabaseBean.java:43)
org.apache.jsp.cmb.carcard.bbs_jsp._jspService(org.apache.jsp.cmb.carcard.bbs_jsp:107)
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)


我基本上对如何设置JSP是文盲,请高手能详细指点,或者告诉我相关教程的网址,多多拜谢!


------解决方案--------------------
不带 <jsp:useBean id= "DBbean " scope= "page " class= "Datebase.DatabaseBean "/>
<jsp:useBean id= "SQLbean " scope= "page " class= "Datebase.RunSql "/> 这样的语句的JSP则能正常运行。
------解决方案--------------------
数据库出错


------解决方案--------------------
java.lang.NullPointerException
一个对空指针的引用错误
开看页面有有没有写java语句
------解决方案--------------------
创建两个bean其中之一的时候出错了,去那里面找
------解决方案--------------------
楼主你把页面的代码贴全了先,另外你去找本学jsp的书看看
------解决方案--------------------
java.lang.NullPointerException
Datebase.DatabaseBean.executeQuery(DatabaseBean.java:43)
空指针异常 连接数据库的问题
------解决方案-------------