Hi Tomas!

Yes, I tried it with older MyFaces versions and they fail as well.
And then I figured why: my bean variable was an Integer, but the getter 
returned int ^^ ;)

So MyFaces is perfectly fine, and I'm the one to blame ;)

All fine, all saved!

txs and LieGrue,
strub


> Am 02.06.2019 um 16:19 schrieb Thomas Andraschko 
> <andraschko.tho...@gmail.com>:
> 
> No idea curently but i would assume that 
> 1) viewParam must be assigned first before execute validation
> 2) it should not throw an npe, also If your int is null
> 
> Please dig a bit deeper and also try 2.3.1 e.g.
> We also released 2.3.4, which fixes a bug related to deltaspike
> 
> Mark Struberg <strub...@yahoo.de> schrieb am So., 2. Juni 2019, 15:03:
> Hi folks!
> 
> I'm pretty rusty in JSF, but came back to it for a smallish application.
> I'm using MyFaces-2.3.3 via TomEE-8.0-M3.
> 
> I have a pate ballotDetail.xhtml which should be bookmarkable. Invocation is
> http://localhost:8080/voting/ballotDetail.xhtml?dswid=-3043&ballotId=10000
> 
> dswid is from DeltaSpike and should be perfectly transparent.
> 
> For the ballotId I have the following viewParam section:
> 
> <f:metadata>
>     <f:viewParam name="ballotId" value="#{ballotDetail.ballotId}"/>
>     <f:viewAction action="#{ballotDetail.loadBallot}"/>
> </f:metadata>
> 
> In the ballotDetail backing bean I have an Integer ballotId which initially 
> is null.
> Funnily the param will not be set, but first MyFaces now invokes a 
> getBallotId() and bombs up with a NPE during validation in phase 
> PROCESS_VALIDATIONS.
> Stacktrace is as follows:
> 
> org.apache.myfaces.view.facelets.el.ContextAwareELException: 
> javax.el.ELException: Error reading [ballotId] on type 
> ....fe.BallotDetailModel$$OwbNormalScopeProxy0]
>         at 
> org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getValue(ContextAwareTagValueExpression.java:101)
>         at 
> javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:356)
>         at javax.faces.component.UIOutput.getValue(UIOutput.java:67)
>         at javax.faces.component.UIInput.getValue(UIInput.java:170)
>         at javax.faces.component.UIInput.validate(UIInput.java:759)
>         at javax.faces.component.UIInput.processValidators(UIInput.java:293)
>         at 
> javax.faces.component.UIViewParameter.processValidators(UIViewParameter.java:215)
>         at 
> javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1458)
>         at 
> javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1451)
>         at 
> javax.faces.component.UIViewRoot._processValidatorsDefault(UIViewRoot.java:1782)
>         at javax.faces.component.UIViewRoot.access$600(UIViewRoot.java:81)
>         at 
> javax.faces.component.UIViewRoot$ProcessValidatorPhaseProcessor.process(UIViewRoot.java:1889)
>         at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1738)
>         at 
> javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:982)
>         at 
> org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:38)
>         at 
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:195)
>         at 
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:142)
>         at 
> org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)
>         at 
> javax.faces.lifecycle.LifecycleWrapper.execute(LifecycleWrapper.java:57)
>         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:204)
> 
> 
> I also tried to set required="false", but didn't help neither. Same Stacktrace
> 
> If I initiate the ballotId with -1 then the setBallotId is properly being set 
> in phase UPDATE_MODEL_VALUES.
> 
> I don't remember such problems. Is this a new behaviour? Is it correct?
> Feels counter intuitive at least.
> 
> txs and LieGrue,
> strub

Reply via email to