Project: Tomcat
Bug 50790 EL parser needs to be more dynamic
Reported: 2011-02-15 15:04:47 | Status: resolved fixed

String.containes(CharSequence) is not being resolved correctly in the following situation: <span class="#{(facesContext.externalContext.request.requestURI.contains(item.url)) ? 'activepage' : ''}">#{template[item.labelKey]}</span> Exception: javax.el.ELException: /faces/template/mainLayout.xhtml: java.lang.NoSuchMethodException: java.lang.String.contains(java.lang.String) at com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:87) at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:75) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:285) at com.sun.faces.renderkit.html_basic.OutputLinkRenderer.encodeChildren(OutputLinkRenderer.java:125) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613) at com.sun.faces.facelets.component.RepeatRenderer.encodeChildren(RepeatRenderer.java:97) at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:496) at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:926) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613) at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126) at com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:157) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.reardeninc.tigris.ui.facesutil.FacesFilter.doFilter(FacesFilter.java:86) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:100) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.NoSuchMethodException: java.lang.String.contains(java.lang.String) at java.lang.Class.getMethod(Class.java:1605) at javax.el.BeanELResolver.invoke(BeanELResolver.java:405) at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:161) at org.apache.el.parser.AstValue.getValue(AstValue.java:159) at org.apache.el.parser.AstChoice.getValue(AstChoice.java:45) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) at com.sun.faces.facelets.el.ELText$ELTextVariable.toString(ELText.java:207) at com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:82) ... 46 more

Files changed in fix:
java/javax/el/BeanELResolver.java java/org/apache/el/parser/AstValue.java test/org/apache/el/TestMethodExpressionImpl.java