今天發現一個超級坑的異常, 如上, 問題所在:頁面中的el表達式中拿不到User對象中的'name'值 頁面裡面的${USER.name}改為${USER.username}就解決了 ...
今天發現一個超級坑的異常,
javax.el.PropertyNotFoundException: Property 'name' not found on type com.fruits.entity.User at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:290) at javax.el.BeanELResolver$BeanProperties.access$300(BeanELResolver.java:243) at javax.el.BeanELResolver.property(BeanELResolver.java:377) at javax.el.BeanELResolver.getValue(BeanELResolver.java:97) at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104) at org.apache.el.parser.AstValue.getValue(AstValue.java:184) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:950) at org.apache.jsp.header_jsp._jspx_meth_c_005fotherwise_005f0(header_jsp.java:288) at org.apache.jsp.header_jsp._jspx_meth_c_005fchoose_005f0(header_jsp.java:225) at org.apache.jsp.header_jsp._jspService(header_jsp.java:105) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:747) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:603) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:542) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:955) at org.apache.jsp.index_jsp._jspService(index_jsp.java:106) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.fruits.web.filter.Autofilter.doFilter(Autofilter.java:61) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.fruits.web.filter.EncodingFilter.doFilter(EncodingFilter.java:39) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1082) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:744)
如上,
問題所在:頁面中的el表達式中拿不到User對象中的'name'值
頁面裡面的${USER.name}改為${USER.username}就解決了