You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Paul Nicolucci (JIRA)" <de...@myfaces.apache.org> on 2012/09/27 20:55:09 UTC
[jira] [Created] (MYFACES-3617) NullPointerException occurs when
using an EL Expression in f:viewParam name attribute
Paul Nicolucci created MYFACES-3617:
---------------------------------------
Summary: NullPointerException occurs when using an EL Expression in f:viewParam name attribute
Key: MYFACES-3617
URL: https://issues.apache.org/jira/browse/MYFACES-3617
Project: MyFaces Core
Issue Type: Bug
Components: JSR-314
Affects Versions: 2.0.15
Environment: WebSphere Application Server 8.0 using MyFaces 2.0.15
Reporter: Paul Nicolucci
When using a f:viewParm on a page and using an EL Expression in the name attribute of the f:viewParm the following NullPointerException occurs:
java.lang.NullPointerException
at org.apache.myfaces.util.AbstractAttributeMap.get(AbstractAttributeMap.java:94)
at javax.faces.component.UIViewParameter.decode(UIViewParameter.java:84)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1377)
at javax.faces.component.UIInput.processDecodes(UIInput.java:188)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1371)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1365)
at javax.faces.component.UIViewRoot._processDecodesDefault(UIViewRoot.java:1406)
at javax.faces.component.UIViewRoot.access$400(UIViewRoot.java:74)
at javax.faces.component.UIViewRoot$ApplyRequestValuesPhaseProcessor.process(UIViewRoot.java:1497)
at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1372)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:759)
at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:38)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
For example the following will work:
<f:viewParam name="firstName" value="#{userBean.user.firstName}" />
but this would fail:
<f:viewParam name="#{userBean.paramName1}" value="#{userBean.user.firstName}" />
I'm willing to code up a fix for this issue, but I need a bit of help figuring out where the fix needs to go. It seems the EL expression works fine in the value attribute just not in the name attribute. However according to the JavaDocs name can be an EL Expression.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3617) NullPointerException occurs when
using an EL Expression in f:viewParam name attribute
Posted by "Paul Nicolucci (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464997#comment-13464997 ]
Paul Nicolucci commented on MYFACES-3617:
-----------------------------------------
Ok I'll get a patch together. Thanks for the help Leonardo.
> NullPointerException occurs when using an EL Expression in f:viewParam name attribute
> -------------------------------------------------------------------------------------
>
> Key: MYFACES-3617
> URL: https://issues.apache.org/jira/browse/MYFACES-3617
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Affects Versions: 2.0.15
> Environment: WebSphere Application Server 8.0 using MyFaces 2.0.15
> Reporter: Paul Nicolucci
> Original Estimate: 8h
> Remaining Estimate: 8h
>
> When using a f:viewParm on a page and using an EL Expression in the name attribute of the f:viewParm the following NullPointerException occurs:
> java.lang.NullPointerException
> at org.apache.myfaces.util.AbstractAttributeMap.get(AbstractAttributeMap.java:94)
> at javax.faces.component.UIViewParameter.decode(UIViewParameter.java:84)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1377)
> at javax.faces.component.UIInput.processDecodes(UIInput.java:188)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1371)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1365)
> at javax.faces.component.UIViewRoot._processDecodesDefault(UIViewRoot.java:1406)
> at javax.faces.component.UIViewRoot.access$400(UIViewRoot.java:74)
> at javax.faces.component.UIViewRoot$ApplyRequestValuesPhaseProcessor.process(UIViewRoot.java:1497)
> at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1372)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:759)
> at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:38)
> at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
> at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
> For example the following will work:
> <f:viewParam name="firstName" value="#{userBean.user.firstName}" />
> but this would fail:
> <f:viewParam name="#{userBean.paramName1}" value="#{userBean.user.firstName}" />
> I'm willing to code up a fix for this issue, but I need a bit of help figuring out where the fix needs to go. It seems the EL expression works fine in the value attribute just not in the name attribute. However according to the JavaDocs name can be an EL Expression.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (MYFACES-3617) NullPointerException occurs when
using an EL Expression in f:viewParam name attribute
Posted by "Paul Nicolucci (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Nicolucci updated MYFACES-3617:
------------------------------------
Status: Patch Available (was: Open)
> NullPointerException occurs when using an EL Expression in f:viewParam name attribute
> -------------------------------------------------------------------------------------
>
> Key: MYFACES-3617
> URL: https://issues.apache.org/jira/browse/MYFACES-3617
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Affects Versions: 2.0.15
> Environment: WebSphere Application Server 8.0 using MyFaces 2.0.15
> Reporter: Paul Nicolucci
> Attachments: UIViewParameter.patch
>
> Original Estimate: 8h
> Remaining Estimate: 8h
>
> When using a f:viewParm on a page and using an EL Expression in the name attribute of the f:viewParm the following NullPointerException occurs:
> java.lang.NullPointerException
> at org.apache.myfaces.util.AbstractAttributeMap.get(AbstractAttributeMap.java:94)
> at javax.faces.component.UIViewParameter.decode(UIViewParameter.java:84)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1377)
> at javax.faces.component.UIInput.processDecodes(UIInput.java:188)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1371)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1365)
> at javax.faces.component.UIViewRoot._processDecodesDefault(UIViewRoot.java:1406)
> at javax.faces.component.UIViewRoot.access$400(UIViewRoot.java:74)
> at javax.faces.component.UIViewRoot$ApplyRequestValuesPhaseProcessor.process(UIViewRoot.java:1497)
> at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1372)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:759)
> at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:38)
> at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
> at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
> For example the following will work:
> <f:viewParam name="firstName" value="#{userBean.user.firstName}" />
> but this would fail:
> <f:viewParam name="#{userBean.paramName1}" value="#{userBean.user.firstName}" />
> I'm willing to code up a fix for this issue, but I need a bit of help figuring out where the fix needs to go. It seems the EL expression works fine in the value attribute just not in the name attribute. However according to the JavaDocs name can be an EL Expression.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3617) NullPointerException occurs when
using an EL Expression in f:viewParam name attribute
Posted by "Paul Nicolucci (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13468601#comment-13468601 ]
Paul Nicolucci commented on MYFACES-3617:
-----------------------------------------
I've provided a patch Leonardo let me know if we need anything else here. I've tested and it does solve the issue I was facing. Thanks!
> NullPointerException occurs when using an EL Expression in f:viewParam name attribute
> -------------------------------------------------------------------------------------
>
> Key: MYFACES-3617
> URL: https://issues.apache.org/jira/browse/MYFACES-3617
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Affects Versions: 2.0.15
> Environment: WebSphere Application Server 8.0 using MyFaces 2.0.15
> Reporter: Paul Nicolucci
> Attachments: UIViewParameter.patch
>
> Original Estimate: 8h
> Remaining Estimate: 8h
>
> When using a f:viewParm on a page and using an EL Expression in the name attribute of the f:viewParm the following NullPointerException occurs:
> java.lang.NullPointerException
> at org.apache.myfaces.util.AbstractAttributeMap.get(AbstractAttributeMap.java:94)
> at javax.faces.component.UIViewParameter.decode(UIViewParameter.java:84)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1377)
> at javax.faces.component.UIInput.processDecodes(UIInput.java:188)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1371)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1365)
> at javax.faces.component.UIViewRoot._processDecodesDefault(UIViewRoot.java:1406)
> at javax.faces.component.UIViewRoot.access$400(UIViewRoot.java:74)
> at javax.faces.component.UIViewRoot$ApplyRequestValuesPhaseProcessor.process(UIViewRoot.java:1497)
> at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1372)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:759)
> at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:38)
> at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
> at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
> For example the following will work:
> <f:viewParam name="firstName" value="#{userBean.user.firstName}" />
> but this would fail:
> <f:viewParam name="#{userBean.paramName1}" value="#{userBean.user.firstName}" />
> I'm willing to code up a fix for this issue, but I need a bit of help figuring out where the fix needs to go. It seems the EL expression works fine in the value attribute just not in the name attribute. However according to the JavaDocs name can be an EL Expression.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (MYFACES-3617) NullPointerException occurs when
using an EL Expression in f:viewParam name attribute
Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leonardo Uribe updated MYFACES-3617:
------------------------------------
Resolution: Fixed
Fix Version/s: 2.1.10
2.0.16
Assignee: Leonardo Uribe
Status: Resolved (was: Patch Available)
Thanks Paul for help testing this patch.
> NullPointerException occurs when using an EL Expression in f:viewParam name attribute
> -------------------------------------------------------------------------------------
>
> Key: MYFACES-3617
> URL: https://issues.apache.org/jira/browse/MYFACES-3617
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Affects Versions: 2.0.15
> Environment: WebSphere Application Server 8.0 using MyFaces 2.0.15
> Reporter: Paul Nicolucci
> Assignee: Leonardo Uribe
> Fix For: 2.0.16, 2.1.10
>
> Attachments: UIViewParameter.patch
>
> Original Estimate: 8h
> Remaining Estimate: 8h
>
> When using a f:viewParm on a page and using an EL Expression in the name attribute of the f:viewParm the following NullPointerException occurs:
> java.lang.NullPointerException
> at org.apache.myfaces.util.AbstractAttributeMap.get(AbstractAttributeMap.java:94)
> at javax.faces.component.UIViewParameter.decode(UIViewParameter.java:84)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1377)
> at javax.faces.component.UIInput.processDecodes(UIInput.java:188)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1371)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1365)
> at javax.faces.component.UIViewRoot._processDecodesDefault(UIViewRoot.java:1406)
> at javax.faces.component.UIViewRoot.access$400(UIViewRoot.java:74)
> at javax.faces.component.UIViewRoot$ApplyRequestValuesPhaseProcessor.process(UIViewRoot.java:1497)
> at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1372)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:759)
> at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:38)
> at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
> at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
> For example the following will work:
> <f:viewParam name="firstName" value="#{userBean.user.firstName}" />
> but this would fail:
> <f:viewParam name="#{userBean.paramName1}" value="#{userBean.user.firstName}" />
> I'm willing to code up a fix for this issue, but I need a bit of help figuring out where the fix needs to go. It seems the EL expression works fine in the value attribute just not in the name attribute. However according to the JavaDocs name can be an EL Expression.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3617) NullPointerException occurs when
using an EL Expression in f:viewParam name attribute
Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464987#comment-13464987 ]
Leonardo Uribe commented on MYFACES-3617:
-----------------------------------------
The fix is trivial, just change from :
public String getName()
{
return (String) getStateHelper().get(PropertyKeys.name);
}
to
public String getName()
{
return (String) getStateHelper().eval(PropertyKeys.name);
}
It seems a valid change. I can't find any reference in the spec or javadoc that suggest the opposite.
> NullPointerException occurs when using an EL Expression in f:viewParam name attribute
> -------------------------------------------------------------------------------------
>
> Key: MYFACES-3617
> URL: https://issues.apache.org/jira/browse/MYFACES-3617
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Affects Versions: 2.0.15
> Environment: WebSphere Application Server 8.0 using MyFaces 2.0.15
> Reporter: Paul Nicolucci
> Original Estimate: 8h
> Remaining Estimate: 8h
>
> When using a f:viewParm on a page and using an EL Expression in the name attribute of the f:viewParm the following NullPointerException occurs:
> java.lang.NullPointerException
> at org.apache.myfaces.util.AbstractAttributeMap.get(AbstractAttributeMap.java:94)
> at javax.faces.component.UIViewParameter.decode(UIViewParameter.java:84)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1377)
> at javax.faces.component.UIInput.processDecodes(UIInput.java:188)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1371)
> at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1365)
> at javax.faces.component.UIViewRoot._processDecodesDefault(UIViewRoot.java:1406)
> at javax.faces.component.UIViewRoot.access$400(UIViewRoot.java:74)
> at javax.faces.component.UIViewRoot$ApplyRequestValuesPhaseProcessor.process(UIViewRoot.java:1497)
> at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1372)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:759)
> at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:38)
> at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
> at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
> For example the following will work:
> <f:viewParam name="firstName" value="#{userBean.user.firstName}" />
> but this would fail:
> <f:viewParam name="#{userBean.paramName1}" value="#{userBean.user.firstName}" />
> I'm willing to code up a fix for this issue, but I need a bit of help figuring out where the fix needs to go. It seems the EL expression works fine in the value attribute just not in the name attribute. However according to the JavaDocs name can be an EL Expression.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira