is it possible to write something like that?
<f:metadata>
<f:viewParam name="#{constantsBean.viewParameterNameForIds}" value="#{displayBean.technicalId}" />
</f:metadata>
I always get a myfaces error and I think it comes from the el expression in the view parameter name.
EDIT: The full stacktrace is:
java.lang.NullpointerException
at org.apache.myfaces.util.AbstractAttributeMap.get(AbstractAttributeMap.java:94)
at javax.faces.component.UIViewParameter.decode(UIViewParameter.java:78)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
at javax.faces.component.UIInput.processDecodes(UIInput.java:178)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1170)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1170)
at javax.faces.component.UIViewRoot._processDecodesDefault(UIViewRoot.java:1316)
at javax.faces.component.UIViewRoot.access$400(UIViewRoot.java:75)
at javax.faces.component.UIViewRoot$ApplyRequestValuesPhaseProcessor.process(UIViewRoot.java:1379)
at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1282)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:718)
at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:34)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at org.apache.myfaces.extensions.cdi.jsf2.impl.listener.phase.CodiLifecycleWrapper.execute(CodiLifecycleWrapper.java:95)
at org.apache.myfaces.extensions.validator.core.startup.ExtValLifecycleWrapper.execute(ExtValLifecycleWrapper.java:61)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1147)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:722)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:449)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at gid.common.technical.filter.InboundProcessingFilter.doFilter(InboundProcessingFilter.java:46)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:919)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1016)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:883)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1659)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1648)
Btw. I am using MyFaces shipped with WebSphere 8, Myfaces Codi and ExtVal.
The <f:viewParam>
documentation says the following about the name
attribute:
Name | Required | Request-Time | Type
-----+----------+--------------+-------------------------------------------------
name | true | false | javax.el.ValueExpression
| | | (must evaluate to java.lang.String)
It says javax.el.ValueExpression
, not java.lang.String
(like as you see on id
attribute which indeed doesn't accept value expressions). So, it does support EL.
I don't use MyFaces, but I just did a test on Mojarra and it works for me. I'm not sure what error exacty you got as you seem to treat it like irrelevant information for some reason and hence didn't mention in your question. The error message namely usually contains the answer to the problem. If you post the full error message, then we may be able to explain the message in layman's terms so that you will be able to understand the error and hence the solution would become obvious. It can for instance have an entirely different cause or maybe even a bug in MyFaces.