码迷,mamicode.com
首页 > 其他好文 > 详细

EL表达式

时间:2017-12-02 21:03:49      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:red   proc   oge   val   lang   rac   org   表达   ace   

初学javaweb,EL表达式犯了一个好笑的错误

org.apache.jasper.JasperException: An exception occurred processing JSP page /dept/listDept.jsp at line 38

35:       <c:forEach items="${dept}" var="dep" varStatus="varSta">
36:       <tr>
37:           <td>${varSta.count }</td>
38:           <td>${dept.deptNo }</td>
39:           <td>${dept.deptName }</td>
40:           <td>${dept.loc }</td>
41:           <td>


Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    cn.edu.lingnan.servlet.ListDeptServlet.doGet(ListDeptServlet.java:31)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
root cause

java.lang.NumberFormatException: For input string: "deptNo"
    java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    java.lang.Integer.parseInt(Integer.java:492)
    java.lang.Integer.parseInt(Integer.java:527)
    javax.el.ListELResolver.coerce(ListELResolver.java:173)
    javax.el.ListELResolver.getValue(ListELResolver.java:52)
    org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
    org.apache.el.parser.AstValue.getValue(AstValue.java:183)
    org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185)
    org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:1026)
    org.apache.jsp.dept.listDept_jsp._jspx_meth_c_005fforEach_005f0(listDept_jsp.java:154)
    org.apache.jsp.dept.listDept_jsp._jspService(listDept_jsp.java:105)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    cn.edu.lingnan.servlet.ListDeptServlet.doGet(ListDeptServlet.java:31)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

出错的地方是:

35:       <c:forEach items="${dept}" var="dep" varStatus="varSta">
36:       <tr>
37:           <td>${varSta.count }</td>
38:           <td>${dept.deptNo }</td>
39:           <td>${dept.deptName }</td>
40:           <td>${dept.loc }</td>
41:           <td>

将dept改成dep就好了。

EL表达式

标签:red   proc   oge   val   lang   rac   org   表达   ace   

原文地址:http://www.cnblogs.com/toohoo/p/7955485.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!