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 Tue, 20 Apr 2010 13:44:50 GMT


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:
>             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="#{}" />
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