myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakob Korherr (JIRA)" <>
Subject [jira] Commented: (MYFACES-2663) NPE in UIParameter when value resolves to null
Date Mon, 19 Apr 2010 17:07:49 GMT


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:
>             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="#{}" />
tag, I get the following NPE when rendering:
> java.lang.NullPointerException
> 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.getOutcomeTargetLinkHref(
> 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlLinkRendererBase.renderOutcomeLinkStart(
> 	at org.apache.myfaces.shared_impl.renderkit.html.HtmlLinkRendererBase.encodeBegin(
> 	at javax.faces.component.UIComponentBase.encodeBegin(
> 	at javax.faces.component.UIComponent.encodeAll(
> 	at javax.faces.component.UIComponent.encodeAll(
> 	at javax.faces.component.UIComponent.encodeAll(
> 	at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(
> 	at org.apache.myfaces.application.ViewHandlerImpl.renderView(
> 	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(
> 	at org.apache.myfaces.lifecycle.LifecycleImpl.render(
> 	at org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.implemetations.LifefcycleProxy.render(
> 	at javax.faces.webapp.FacesServlet.service(
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(
> 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.

View raw message