org.apache.jasper.JasperException:无法编译JSP类 怎么解决??
typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatprevent...
type Exception report
message
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 /sportcollege/WebRoot/index.jsp at line 97
94:
95: //第一个参数代表栏目的id
96: //第二个和第三个是 栏目1-10的内容查询出来
97: iterator = newsFactory.list(36,1,8);
98: while(iterator.hasNext()) {
99: news = (News)iterator.next();
100: String title = news.getTitle();
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.NullPointerException
java.io.FileOutputStream.<init>(Unknown Source)
java.io.FileOutputStream.<init>(Unknown Source)
net.ijsp.news.a.c.a(Unknown Source)
net.ijsp.news.a.c.<init>(Unknown Source)
net.ijsp.news.a.b.init(Unknown Source)
net.ijsp.news.a.b.<init>(Unknown Source)
net.ijsp.news.news.mysql.c.list(Unknown Source)
org.apache.jsp.sportcollege.WebRoot.index_jsp._jspService(index_jsp.java:331)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs. 展开
message
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 /sportcollege/WebRoot/index.jsp at line 97
94:
95: //第一个参数代表栏目的id
96: //第二个和第三个是 栏目1-10的内容查询出来
97: iterator = newsFactory.list(36,1,8);
98: while(iterator.hasNext()) {
99: news = (News)iterator.next();
100: String title = news.getTitle();
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.NullPointerException
java.io.FileOutputStream.<init>(Unknown Source)
java.io.FileOutputStream.<init>(Unknown Source)
net.ijsp.news.a.c.a(Unknown Source)
net.ijsp.news.a.c.<init>(Unknown Source)
net.ijsp.news.a.b.init(Unknown Source)
net.ijsp.news.a.b.<init>(Unknown Source)
net.ijsp.news.news.mysql.c.list(Unknown Source)
org.apache.jsp.sportcollege.WebRoot.index_jsp._jspService(index_jsp.java:331)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs. 展开
4个回答
展开全部
iterator = newsFactory().list(36,1,8);
一定在最上面写入: import 包的名字(含有这个方法的包).类(含有这个方法的类)*
试一下,不行的话,在改
一定在最上面写入: import 包的名字(含有这个方法的包).类(含有这个方法的类)*
试一下,不行的话,在改
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
有没使用import集合类?<%@ import="java.util.*,java.util.*" pageEncoding="UTF-8"%>
追问
加上显示这样的
追答
写错了,更正:
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
500错误就是你的java代码出了问题,仔细查看你的java方法就能找到问题根源了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
newsFactory.list(36,1,8);
这代码 你导入包路径了没有??
这代码 你导入包路径了没有??
更多追问追答
追问
什么路径
追答
你先输出打印 iterator.size(); 看看 。iterator 对象应该是空的。 然后 你在 newsFactory.list(36,1,8); 方法里面 应该没对 空值 进行异常处理。最好把整个index.jsp 代码都贴出来看看。
还有list 方法的代码。
其实,你这样写的代码很有问题。你得把java代码跟页面剥离出来。
也有利于你调试错误。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询