You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Whittaker <mi...@ntlworld.com> on 2003/06/08 01:19:56 UTC
How to specify the FormBean in an iterate tags name property?
How do I specify the FormBean in the <iterate> name property?
I have DynaActionForm, with a List property (myList),
I populate it in my Action with a bunch of beans that have a get & setTag()
method.
This is in my <html:form>
<logic:iterate id="cols" indexId="ctr" name="????">
<html:checkbox name="cols" property='<%= "myList["+ctr+"].tag" %>'
value="ON" />
</logic:iterate>
How do I specify the FormBean in the iterate name property?
Or why else do I get this exception:
java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:326)
at
org.apache.jasper.runtime.PageContextImpl.findAttribute(PageContextImpl.java
:302)
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:787)
...
TIA
--
Mike W
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: How to specify the FormBean in an iterate tags name property?
Posted by Rodrigo di Lorenzo Lopes <rl...@linux.ime.usp.br>.
Let you FormBean has the name myform
so ... in jsp, use:
<logic:iterate name=myform property=myList id="cols">
important :
YOU MUST SPECIFY YOUR FormBean to any tag inst part of html:form
Mike Whittaker writes:
>
> How do I specify the FormBean in the <iterate> name property?
>
> I have DynaActionForm, with a List property (myList),
> I populate it in my Action with a bunch of beans that have a get & setTag()
> method.
>
> This is in my <html:form>
>
> <logic:iterate id="cols" indexId="ctr" name="????">
> <html:checkbox name="cols" property='<%= "myList["+ctr+"].tag" %>'
> value="ON" />
> </logic:iterate>
>
> How do I specify the FormBean in the iterate name property?
>
> Or why else do I get this exception:
> java.lang.NullPointerException
> at java.util.Hashtable.get(Hashtable.java:326)
> at
> org.apache.jasper.runtime.PageContextImpl.findAttribute(PageContextImpl.java
> :302)
> at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:787)
> ...
> TIA
> --
> Mike W
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
--
Rodrigo di Lorenzo Lopes (Mineirinho) - ICQ 52982003
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org