zoukankan      html  css  js  c++  java
  • EL表达式

    初学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就好了。

  • 相关阅读:
    OpenStack对象存储管理手册(5) OpenStack对象存储系统管理3
    hdu1568Fibonacci
    智能手机中显示信号强度格数
    上篇日本人经营之道 一破坏对手的情绪乱其方寸
    基于Wince的计算器程序
    shell 字符串操作
    轻松记住大端小端的含义
    如何把手机变成你的救生设备
    PM是一个事实
    mysql 5.6 online ddl 测试
  • 原文地址:https://www.cnblogs.com/toohoo/p/7955485.html
Copyright © 2011-2022 走看看