users@javaserverfaces.java.net

Re: Does the EL swallow NullPointerExceptions?

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Wed, 02 May 2007 13:00:49 -0700

Adam,

What version of 1.2 are you using? If I recall correctly, Ed added a
fix in the EL wrapper area to prevent exception
swallowing. This fix was made available in 1.2_04 P01.



Adam Brod wrote:
>
> Is it possible that the EL would swallow NullPointerExceptions that
> bubble up from the persistence layer? We have a bean property in a
> managed bean that loads some items from the DB and wraps them in a
> DataModel. It seems that when the method is called through the EL:
>
> <h:dataTable value="#{myBean.dataModel}" var="item">
>
> The NullPointerException is swallowed and the page continues to render
> (causing all sorts of problems). If this is expected EL behavior,
> then I'll have to ensure my javabean properties never throw NPEs. I
> know the EL is pretty relaxed about handling null values when trying
> to output Strings on the page. However, since this value is a
> DataModel, and is not being coerced into a String, I would think the
> NPE should propagate up and send the user to an error page.
>
> Any tips would be greatly appreciated.
> *
> Adam Brod*/
> Product Development Team/
> Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.
>
>