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

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

>From the spec javadoc of h:link and h:button:

"[...] Any child UIParameter components are appended to the String to be output 
as the value of the "href" attribute as query parameters before rendering. 
[...] The name of the UIParameter goes on the left hand side, and the value of 
the UIParameter on the right hand side. The name and the value must be 
URLEncoded. Each UIParameter instance is separated by an ampersand, as dictated 
in the URL spec."

So this tells us nothing about the handling of null values. Furthermore the 
docs of f:param only say that it is up to the parent how to handle the 
component. So I think it is ok (and also better) to not throw a 
NullPointerException here. Maybe not adding the parameter at all would be a 
good idea. However I will check the commit history and also Mojarra's behavior 
before I do something!

> 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
>
> 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.

Reply via email to