J'ai créé une fonction EL personnalisée (basée sur JSP) à utiliser dans la balise rendue. La fonction renvoie un booléen pour décider si un composant de page doit être rendu sur une page ou non. Je l'importe sur la page jsp en utilisant <% @ taglib uri = "/WEB-INF/mine.tld" prefix = "g"%>.La fonction JSF Custom EL ne fonctionne que sur le premier chargement de la page
Tout fonctionne parfaitement sur le premier chargement de la page jsp. Une fois qu'un bouton est cliqué, le formulaire soumet et puis j'obtiens des erreurs comme 'No ClassLoaders trouvé pour: la classe qui implémente ma fonction EL' et 'Fonction non trouvée'. Qu'est-ce qui se passe ici? Quelle sera une solution?
La classe qui implémente la fonction (com.util.WebContextLoader) est inclus en tant que classe d'utilité dans la guerre.
Voici la trace de la pile.
09:22:31,112 ERROR [STDERR] java.lang.ClassNotFoundException: No ClassLoaders found for: com.util.WebContextLoader
09:22:31,112 ERROR [STDERR] at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
09:22:31,112 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
09:22:31,112 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
09:22:31,112 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
09:22:31,112 ERROR [STDERR] at java.lang.Class.forName0(Native Method)
09:22:31,112 ERROR [STDERR] at java.lang.Class.forName(Class.java:169)
09:22:31,112 ERROR [STDERR] at org.apache.el.lang.FunctionMapperImpl$Function.getMethod(FunctionMapperImpl.java:147)
09:22:31,112 ERROR [STDERR] at org.apache.el.lang.FunctionMapperImpl.resolveFunction(FunctionMapperImpl.java:53)
09:22:31,112 ERROR [STDERR] at org.apache.el.parser.AstFunction.getValue(AstFunction.java:71)
09:22:31,112 ERROR [STDERR] at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
09:22:31,112 ERROR [STDERR] at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
09:22:31,112 ERROR [STDERR] at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:390)
09:22:31,112 ERROR [STDERR] at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1018)
09:22:31,112 ERROR [STDERR] at javax.faces.component.UIForm.processDecodes(UIForm.java:209)
09:22:31,112 ERROR [STDERR] at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
09:22:31,112 ERROR [STDERR] at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:540)
09:22:31,112 ERROR [STDERR] at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
09:22:31,112 ERROR [STDERR] at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
09:22:31,112 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
09:22:31,112 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:22:31,112 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
09:22:31,112 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
09:22:31,112 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
09:22:31,112 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:420)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
09:22:31,112 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
09:22:31,112 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
09:22:31,112 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
09:22:31,112 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
09:22:31,112 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
09:22:31,112 WARN [lifecycle] org.apache.jasper.el.JspELException: /register.jsp(45,2) '#{g:displayPageComponent('registrationPage', 'regUnit')}' Function 'g:displayPageComponent' not found
javax.faces.FacesException: org.apache.jasper.el.JspELException: /register.jsp(45,2) '#{g:displayPageComponent('registrationPage', 'regUnit')}' Function 'g:displayPageComponent' not found
at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:393)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1018)
at javax.faces.component.UIForm.processDecodes(UIForm.java:209)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:540)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
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.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:420)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.jasper.el.JspELException: /register.jsp(45,2) '#{g:displayPageComponent('registrationPage', 'regUnit')}' Function 'g:displayPageComponent' not found
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:107)
at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:390)
... 34 more
Veuillez modifier la question pour inclure l'ensemble de la pile. Veuillez indiquer exactement où vous avez placé la classe de fonction. S'il vous plaît également enregistrer votre compte Stackoverflow, ceci est votre deuxième compte et vous avez perdu toute l'histoire et la réputation! Votre premier compte est ici: http://stackoverflow.com/users/315832/jsfq – BalusC
J'ai changé javax.faces.STATE_SAVING_METHOD en web.xml au serveur du client et cela a résolu mon problème pour le moment. Je ne suis pas sûr si je veux garder ce paramètre à long terme (probablement un impact sur les performances?). – jsfQ