You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by rob <ro...@softhome.net> on 2002/09/16 08:54:32 UTC

NullPointerException - explanation?

I'm receiving a NullPointerException while trying to use <nested:nest
(and other nested tags) I'm confused about why the error is occuring,
perhaps someone could explain where I've gone wrong.

I basically have a form that looks a little something like this.

public class Form
{
	private Collection c = new ArrayList();

public Collection getList() { return c; }

}

and the .jsp looks like this and I've shown all struts tags use. (I'm
aware that there would be no actual output from this) I've trimmed it
down to eliminate the suggestion that some other tags are causing my
problem.

<html:form action="listaction">
<nested:nest property="list">
</nested:nest>
</html:form>

When I go to load the list.jsp I receive JasperException with the root
cause being a NullPointerException.

java.lang.NullPointerException:
	at 
org.apache.struts.taglib.nested.NestedPropertyHelper.getNestedProperty(NestedPropertyHelper.java:174)
.
.
.

Any suggestions?

Thanks

Rob


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: NullPointerException - explanation? (Solved)

Posted by rob <ro...@softhome.net>.
Foolish logic in the action.

rob wrote:
> I'm receiving a NullPointerException while trying to use <nested:nest
> (and other nested tags) I'm confused about why the error is occuring,
> perhaps someone could explain where I've gone wrong.
> 
> I basically have a form that looks a little something like this.
> 
> public class Form
> {
>     private Collection c = new ArrayList();
> 
> public Collection getList() { return c; }
> 
> }
> 
> and the .jsp looks like this and I've shown all struts tags use. (I'm
> aware that there would be no actual output from this) I've trimmed it
> down to eliminate the suggestion that some other tags are causing my
> problem.
> 
> <html:form action="listaction">
> <nested:nest property="list">
> </nested:nest>
> </html:form>
> 
> When I go to load the list.jsp I receive JasperException with the root
> cause being a NullPointerException.
> 
> java.lang.NullPointerException:
>     at 
> org.apache.struts.taglib.nested.NestedPropertyHelper.getNestedProperty(NestedPropertyHelper.java:174) 
> 
> .
> .
> .
> 
> Any suggestions?
> 
> Thanks
> 
> Rob
> 
> 
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>