Error description of the value mechanism of El Expression: at Javax.el.beanelresolver$beanproperties.get (beanelresolver.java:237)

Source: Internet
Author: User

First post the error message:

December 14, 2017 10:54:42afternoon Org.apache.catalina.core.ApplicationDispatcher InvokeSEVERE:Servlet.service () forservlet JSP threw exceptionJavax.el.PropertyNotFoundException:Property ' Classroomid 'Not  found on type cn.toohoo.classroom.dto.Classroom at Javax.el.beanelresolver$beanproperties.get ( Beanelresolver.java:237) at javax.el.beanelresolver$beanproperties.access$(beanelresolver.java:214) at Javax.el.BeanELResolver.property (Beanelresolver.java:325) at Javax.el.BeanELResolver.getValue (Beanelresolver.java:85) at Org.apache.jasper.el.JasperELResolver.getValue (Jasperelresolver.java:104) at Org.apache.el.parser.AstValue.getValue (Astvalue.java:183) at Org.apache.el.ValueExpressionImpl.getValue (Valueexpressionimpl.java:185) at Org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate (Pagecontextimpl.java:1026) at org.apache.jsp.admin.classroom.listclassroom_jsp._jspx_meth_c_005fforeach_005f0 (Listclassroom_jsp.java: 356) at org.apache.jsp.admin.classroom.listclassroom_jsp._jspx_meth_c_005fif_005f0 (Listclassroom_jsp.java:314) at Org.apache.jsp.admin.classroom.listclassroom_jsp._jspservice (Listclassroom_jsp.java:218) at Org.apache.jasper.runtime.HttpJspBase.service (Httpjspbase.java:70) at Javax.servlet.http.HttpServlet.service (Httpservlet.java:728) at Org.apache.jasper.servlet.JspServletWrapper.service (Jspservletwrapper.java:432) at Org.apache.jasper.servlet.JspServlet.serviceJspFile (Jspservlet.java:390) at Org.apache.jasper.servlet.JspServlet.service (Jspservlet.java:334) at Javax.servlet.http.HttpServlet.service (Httpservlet.java:728) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (Applicationfilterchain.java:305) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (Applicationfilterchain.java:210) at Org.apache.catalina.core.ApplicationDispatcher.invoke (Applicationdispatcher.java:749) at Org.apache.catalina.core.ApplicationDispatcher.processRequest (Applicationdispatcher.java:487) at Org.apache.catalina.core.ApplicationDispatcher.doForward (Applicationdispatcher.java:412) at Org.apache.catalina.core.ApplicationDispatcher.forward (Applicationdispatcher.java:339) at Cn.toohoo.classroom.servlet.ClassroomServlet.listClassroom (Classroomservlet.java:194) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke (Nativemethodaccessorimpl.java:57) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (Method.java:601) at Cn.toohoo.baseservlet.BaseServlet.service (Baseservlet.java:44) at Javax.servlet.http.HttpServlet.service (Httpservlet.java:728) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (Applicationfilterchain.java:305) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (Applicationfilterchain.java:210) at Org.apache.catalina.core.StandardWrapperValve.invoke (Standardwrappervalve.java:222) at Org.apache.catalina.core.StandardContextValve.invoke (Standardcontextvalve.java:123) at Org.apache.catalina.authenticator.AuthenticatorBase.invoke (Authenticatorbase.java:502) at Org.apache.catalina.core.StandardHostValve.invoke (Standardhostvalve.java:171) at Org.apache.catalina.valves.ErrorReportValve.invoke (Errorreportvalve.java:99) at Org.apache.catalina.valves.AccessLogValve.invoke (Accesslogvalve.java:953) at Org.apache.catalina.core.StandardEngineValve.invoke (Standardenginevalve.java:118) at Org.apache.catalina.connector.CoyoteAdapter.service (Coyoteadapter.java:408) at Org.apache.coyote.http11.AbstractHttp11Processor.process (Abstracthttp11processor.java:1023) at Org.apache.coyote.abstractprotocol$abstractconnectionhandler.process (Abstractprotocol.java:48X) at Org.apache.tomcat.util.net.jioendpoint$socketprocessor.run (Jioendpoint.java:310) at Java.util.concurrent.ThreadPoolExecutor.runWorker (Threadpoolexecutor.java:1110) at Java.util.concurrent.threadpoolexecutor$worker.run (Threadpoolexecutor.java:603) at Java.lang.Thread.run (Thread.java:722) java.lang.reflect.InvocationTargetException at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke (Nativemethodaccessorimpl.java:57) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (Method.java:30T) at Cn.toohoo.baseservlet.BaseServlet.service (Baseservlet.java:44) at Javax.servlet.http.HttpServlet.service (Httpservlet.java:728) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (Applicationfilterchain.java:305) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (Applicationfilterchain.java:210) at Org.apache.catalina.core.StandardWrapperValve.invoke (Standardwrappervalve.java:222) at Org.apache.catalina.core.StandardContextValve.invoke (Standardcontextvalve.java:123) at Org.apache.catalina.authenticator.AuthenticatorBase.invoke (Authenticatorbase.java:502) at Org.apache.catalina.core.StandardHostValve.invoke (Standardhostvalve.java:171) at Org.apache.catalina.valves.ErrorReportValve.invoke (Errorreportvalve.java:99) at Org.apache.catalina.valves.AccessLogValve.invoke (Accesslogvalve.java:953) at Org.apache.catalina.core.StandardEngineValve.invoke (Standardenginevalve.java:118) at Org.apache.catalina.connector.CoyoteAdapter.service (Coyoteadapter.java:408) at Org.apache.coyote.http11.AbstractHttp11Processor.process (Abstracthttp11processor.java:1023) at Org.apache.coyote.abstractprotocol$abstractconnectionhandler.process (Abstractprotocol.java:589) at Org.apache.tomcat.util.net.jioendpoint$socketprocessor.run (Jioendpoint.java:310) at Java.util.concurrent.ThreadPoolExecutor.runWorker (Threadpoolexecutor.java:1110) at Java.util.concurrent.threadpoolexecutor$worker.run (Threadpoolexecutor.java:30V) at Java.lang.Thread.run (Thread.java:722) caused By:org.apache.jasper.JasperException:An exception occurred processing JSP page/admin/classroom/listclassroom.jsp at line 131128: <c:foreach var= "Classroom" items= "${r                                      EquestScope.pageBean.pageData} "varstatus=" vs ">129: <tr>130: <td>${vs.count}</td>131: <td>${classroom.class                                      Roomid}</td>132: <td>${classroom.classroomname}</td>133: <td>${classroom.classroomtype}</td>134: &lt ; Td>${classroom.classroomcapacity}</td>stacktrace:at org.apache.jasper.servlet.JspServletWrapper.handleJspException (Jspservletwrapper.java:568) at Org.apache.jasper.servlet.JspServletWrapper.service (Jspservletwrapper.java:470) at Org.apache.jasper.servlet.JspServlet.serviceJspFile (Jspservlet.java:390) at Org.apache.jasper.servlet.JspServlet.service (Jspservlet.java:334) at Javax.servlet.http.HttpServlet.service (Httpservlet.java:728) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (Applicationfilterchain.java:305) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (Applicationfilterchain.java:210) at Org.apache.catalina.core.ApplicationDispatcher.invoke (Applicationdispatcher.java:749) at Org.apache.catalina.core.ApplicationDispatcher.processRequest (Applicationdispatcher.java:487) at Org.apache.catalina.core.ApplicationDispatcher.doForward (Applicationdispatcher.java:412) at Org.apache.catalina.core.ApplicationDispatcher.forward (Applicationdispatcher.java:339) at Cn.toohoo.classroom.servlet.ClassroomServlet.listClassroom (Classroomservlet.java:194)    ... 22morecaused By:javax.el.PropertyNotFoundException:Property' Classroomid 'Not found on type cn.toohoo.classroom.dto.Classroom at Javax.el.beanelresolver$beanproperties.get (beanelresolver . Java:237) at javax.el.beanelresolver$beanproperties.access$(beanelresolver.java:214) at Javax.el.BeanELResolver.property (Beanelresolver.java:325) at Javax.el.BeanELResolver.getValue (Beanelresolver.java:85) at Org.apache.jasper.el.JasperELResolver.getValue (Jasperelresolver.java:104) at Org.apache.el.parser.AstValue.getValue (Astvalue.java:183) at Org.apache.el.ValueExpressionImpl.getValue (Valueexpressionimpl.java:185) at Org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate (Pagecontextimpl.java:1026) at org.apache.jsp.admin.classroom.listclassroom_jsp._jspx_meth_c_005fforeach_005f0 (Listclassroom_jsp.java: 356) at org.apache.jsp.admin.classroom.listclassroom_jsp._jspx_meth_c_005fif_005f0 (Listclassroom_jsp.java:314) at Org.apache.jsp.admin.classroom.listclassroom_jsp._jspservice (Listclassroom_jsp.java:218) at Org.apache.jasper.runtime.HttpJspBase.service (Httpjspbase.java:70) at Javax.servlet.http.HttpServlet.service (Httpservlet.java:728) at Org.apache.jasper.servlet.JspServletWrapper.service (Jspservletwrapper.java:432)    ... More

Then follow the error message

Javax.el.PropertyNotFoundException:Property ' Classroomid ' not found on type Cn.toohoo.classroom.dto.Classroom

To classroom entity class lookup

    PrivateString Classroomid; PrivateString Classroomname; PrivateString Classroomtype; PrivateString classroomcapacity;  PublicString Getclassroomid () {returnClassroomid; }     Public voidSetclassroomid (String classroomid) { This. Classroomid =Classroomid; }     PublicString Getclassroomname () {returnClassroomname; }     Public voidsetclassroomname (String classroomname) { This. Classroomname =Classroomname; }

is the existence of the private String classroomid; Yes, and then wondering, then various modifications,

。。。。。。。。。。。。。。。

Finally, go back to the JSP

<c:if test= "${not Empty RequestScope.pageBean.pageData}" > <c:foreach var= "Classroom" items=                                     "${requestscope.pagebean.pagedata}" varstatus= "vs" > <tr> <td>${vs.count}</td> <td>${classroom.classroomid}&lt                                     ;/td> <td>${classroom.classroomname}</td> <td>${classroom.classroomtype}</td> <td>${classroom.classro Omcapacity}</td> <td> <a HRE f= "<c:url value= '/classroomservlet?method=queryclassroom&classroomid=${classroom.classroomid} '/>" > Modify </a> <a href= "<c:url value="/classroomservlet?method=deleteclassroo M&classroomid=${classroom.clasSroomid} '/> ' > Delete </a> </td> </ Tr> </c:forEach> </c:if>

Simply remove the line containing the ${classroom.classroomid}

Change into

 <c:if  test= "${not empty RequestScope.pageBean.pageD ATA} "> <c:foreach var=" Classroom "items=" ${requestscope.pagebean.pagedata} "varstatus= "vs" > <tr> <td>${vs.count}</td>                                                                          ; <td>${classroom.classroomname}</td> <td>${classroom.classroomtype}                                     </td> <td>${classroom.classroomcapacity}</td>                                   <td> </td> </tr> </c:forEach> </c:
   
    if ; 
   

A visit to the webpage passed

Why ${classroom.classroomname} can pass through and ${classroom.classroomid} but not go through, continue to check classroom entity class

Go back to JSP to change ${classroom.classroomid} to ${classroom.classroomid}

Redeploy, access through, guys

Summary: MyEclipse error is to be very serious analysis, and this mistake let me to the El expression value method to understand the deeper, is through the public method to take the value of the external, so say the name must be correct, at the same time for this myeclipse generated code I really depressed burst, serious inspection! Learn lessons.

Error description of the value mechanism of El Expression: at Javax.el.beanelresolver$beanproperties.get (beanelresolver.java:237)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.