javax.el.PropertyNotFoundException

问题描述

第一次用的ibatis结合struts2,不明白为什么jsp页面一用EL表达式就报错,这个UserID属性都设置getset 方法了jsp页面出错的地方<input type="hidden" name="userId" value="${userInfo.UserID}">异常:javax.el.PropertyNotFoundException: Property 'UserID' not found on type com.shop.entity.UserInfoat javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)at javax.el.BeanELResolver.property(BeanELResolver.java:279)at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at org.apache.el.parser.AstValue.getValue(AstValue.java:123)at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:935)at org.apache.jsp.advice.users.updateUserInfo_jsp._jspService(updateUserInfo_jsp.java:150)at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:362)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266)at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)at java.lang.Thread.run(Thread.java:619) 问题补充:dunedain 写道

解决方案

和那个没有关系,el表达式取值时是根据getXXX来的,如果bean有一个getXXX()方法(对于布尔值则是isXXX()方法)则认为有一个xXX属性(去掉get或is并将首字母小写)
解决方案二:
${userInfo.UserID}U小写

时间: 2024-09-09 13:08:26

javax.el.PropertyNotFoundException的相关文章

javax el-关于javax.el.PropertyNotFoundException的问题,谢谢啦

问题描述 关于javax.el.PropertyNotFoundException的问题,谢谢啦 Target Unreachable, identifier 'userBean' resolved to null

[java] javax.el.PropertyNotFoundException: Property &amp;#39;id&amp;#39; not found on type bean.Student

问题提出: 在使用MyEclipse开发Java Web时,调用DAO和Java Bean出现了如下错误: 严重: Servlet.service() for servlet [jsp] in context with path [/JDBCbyDao] threw exception [An exception occurred processing JSP page /student.jsp at line 3734: 35: <c:forEach items="${ studentL

javax.el.PropertyNotFoundException求解

问题描述 javax.el.PropertyNotFoundException求解 JSP报错javax.el.PropertyNotFoundException: Property 'a' not found on type com.cn.action.system.FlowController$Flow 有这个属性,有getset方法..拼写没错,, 类结构 class Flow{ private String a; private String b; private Integer c;

Java+MyEclipse+Tomcat (五)DAO和Java Bean实现数据库和界面分开操作

        正如前面一篇文章的介绍,当使用Servlet提交表单和JSP数据库查询时,总是相互交叉着的处理,要么在JSP中通过<%...%>内嵌Java代码操作数据库,要么JSP中通过Post方法提交表单Form,在Java中通过Servlet获取请求/响应,再通过Java中out.println("<HTML>...")输出数据库中值.         此篇文章主要讲述通过DAO和Java Bean操作数据库,把链接数据库.数据库操作.前端界面显示分模块化

jbpm流程节点报错

问题描述 javax.el.PropertyNotFoundException:Cannotresolveidentifier'jiancha'

web项目部署.jsp 找不到id

问题描述 web项目部署.jsp 找不到id ${news.id} ${news.title} ${news.timelength} /c:forEach 错误提示: javax.el.PropertyNotFoundException: Property 'id' not found on type java.lang.String javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:266) javax.el.Bean

在JSP页面获取后台action封装的参数,这个参数里面又含有两个对象,二层引用,报错

问题描述 在JSP页面获取后台action封装的参数,这个参数里面又含有两个对象,二层引用,报错 javax.el.PropertyNotFoundException: Property 'userAccount' not found on type java.lang.String 上面是报错信息, 下面是JSP页面: 用户名: ${commentlist.userAccount.userName } 职业: ${commentlist.userAccount.job } ${commentl

搞死人了!我解决不了!

问题描述 Servlet.service() for servlet jsp threw exceptionjavax.el.PropertyNotFoundException: Property 'expendId' not found on type cn.com.kxrj.common.model.QuestionTypeat javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)at javax.el.Bea

JSP EL表达式支持方法调用

在JEE6中,JSP中的EL表达式支持带参数的方法调用了.可以像这样调用: ${foo.bar(baz)} . 最新的实现是JUEL,大家可以下载试用一下.下面代码就是测试如何使用: // the ExpressionFactory implementation is de.odysseus.el.ExpressionFactoryImpl| System.setProperty("javax.el.methodInvocations", "true"); Expr