日期:2014-05-20  浏览次数:20721 次

jsp 代码错误
type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: For input string: "1</a>"
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.NumberFormatException: For input string: "1</a>"
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
java.lang.Integer.parseInt(Integer.java:456)
java.lang.Integer.parseInt(Integer.java:497)
org.apache.jsp.reply_jsp._jspService(reply_jsp.java:48)
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



请问一下这是什么错误啊,代码那么长不知道改哪里啊

------解决方案--------------------
.NumberFormatException

你想转化为整数,但是无法转为整数,因为有非法符号
------解决方案--------------------
java.lang.NumberFormatException: For input string: "1</a>"
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)

 这错误很明显吧、

org.apache.jsp.reply_jsp._jspService(reply_jsp.java:48)
把48行贴出来看看。
------解决方案--------------------
java.lang.NumberFormatException: For input string: "1</a>"
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
根据这两句可以看出数据类型转换有问题!格式不对,或者出现了空值
------解决方案--------------------
探讨

能不能具体到那个语句啊,我看着都对

------解决方案--------------------
out.println(request.getParameter("id"));
out.println(request.getParameter("rootId"));

先看看传过来的参数是什么值,先判断 null 和"" 嘛


------解决方案--------------------
Java code


//从上个页面传过来的id或者rootId含有非数字格式的数据,多了个</a>,按楼上说的先把这俩参数打印出来看看
<% 
int id = Integer.parseInt(request.getParameter("id"));
int rootId = Integer.parseInt(request.getParameter("rootId"));

 %>

------解决方案--------------------
探讨

就是多了个</a>知道啦。谢啦

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