myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakob Korherr (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (MYFACES-2663) NPE in UIParameter when value resolves to null
Date Tue, 20 Apr 2010 13:44:50 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12858886#action_12858886
] 

Jakob Korherr commented on MYFACES-2663:
----------------------------------------

While looking through the code that uses UIParameter I found out that nearly every method
uses a different way to get its UIParameter children, which is very inconsistent. So I introduced
HtmlRendererUtils.getValidUIParameterChildren() with a few parameters to indicate whether
or not to include null-values. This method is now used across the code base to get all valid
UIParameters, so ugly NPEs like this one should not happen anymore.

However I will leave the issue open until the tests are committed.

> NPE in UIParameter when value resolves to null
> ----------------------------------------------
>
>                 Key: MYFACES-2663
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2663
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.1-SNAPSHOT
>            Reporter: Jan-Kees van Andel
>            Assignee: Jakob Korherr
>         Attachments: MYFACES-2663-tests.patch
>
>
> When I have a null value in an <f:param value="#{expr.that.evaluates.to.null}" />
tag, I get the following NPE when rendering:
> java.lang.NullPointerException
> 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.getOutcomeTargetLinkHref(HtmlRendererUtils.java:1883)
> 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlLinkRendererBase.renderOutcomeLinkStart(HtmlLinkRendererBase.java:742)
> 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlLinkRendererBase.encodeBegin(HtmlLinkRendererBase.java:123)
> 	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:430)
> 	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:605)
> 	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
> 	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
> 	at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1117)
> 	at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:231)
> 	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:122)
> 	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:207)
> 	at org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations.LifefcycleProxy.render(LifefcycleProxy.java:74)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
> I don't know what the spec says or what Mojarra does, but I think we should at least
do better than a NPE, for example appending an empty string to the parameter list...
> Any ideas?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message