You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by andy wix <st...@hotmail.com> on 2004/12/01 12:18:33 UTC
simple html:select issue
Hi,
I am trying to use select and options tags in the simplest way where I have
an ArrayList of Strings in the request (Logs) and I wish the one selected to
end up in the form's logName variable.
According to page 296 of Struts in action I think this should work:
<html:select property="logName">
<html:options collection="Logs" />
</html:select>
but I get:
[ServletException in:/selectLog.jsp] No name specified'
java.lang.IllegalArgumentException: No name specified at
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:721)
at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
at
etc
Thanks,
Andy
_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://www.msn.co.uk/messenger
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: simple html:select issue
Posted by Mark Lowe <me...@gmail.com>.
Corey's suggestion could work with arraylist.
If you use your code
<html:select collection="Logs" ..
Then the arrayList needs to be cast to an array.
request.setAttribute("Logs",myList.toArray());
Mark
On Wed, 1 Dec 2004 20:10:16 +0800, Corey Scott <co...@gmail.com> wrote:
> Andy,
>
> I believe you are after something like this:
> <html:select property="logName">
> <html:optionsCollection name="Logs" label="logName" value="logId" />
> </html:select>
>
> Regards,
> Corey
>
>
>
> On Wed, 01 Dec 2004 11:18:33 +0000, andy wix <st...@hotmail.com> wrote:
> > Hi,
> >
> > I am trying to use select and options tags in the simplest way where I have
> > an ArrayList of Strings in the request (Logs) and I wish the one selected to
> > end up in the form's logName variable.
> > According to page 296 of Struts in action I think this should work:
> >
> > <html:select property="logName">
> > <html:options collection="Logs" />
> > </html:select>
> >
> > but I get:
> >
> > [ServletException in:/selectLog.jsp] No name specified'
> > java.lang.IllegalArgumentException: No name specified at
> > org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:721)
> > at
> > org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
> > at
> >
> > etc
> >
> > Thanks,
> > Andy
> >
> > _________________________________________________________________
> > It's fast, it's easy and it's free. Get MSN Messenger today!
> > http://www.msn.co.uk/messenger
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: simple html:select issue
Posted by Corey Scott <co...@gmail.com>.
Andy,
I believe you are after something like this:
<html:select property="logName">
<html:optionsCollection name="Logs" label="logName" value="logId" />
</html:select>
Regards,
Corey
On Wed, 01 Dec 2004 11:18:33 +0000, andy wix <st...@hotmail.com> wrote:
> Hi,
>
> I am trying to use select and options tags in the simplest way where I have
> an ArrayList of Strings in the request (Logs) and I wish the one selected to
> end up in the form's logName variable.
> According to page 296 of Struts in action I think this should work:
>
> <html:select property="logName">
> <html:options collection="Logs" />
> </html:select>
>
> but I get:
>
> [ServletException in:/selectLog.jsp] No name specified'
> java.lang.IllegalArgumentException: No name specified at
> org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:721)
> at
> org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
> at
>
> etc
>
> Thanks,
> Andy
>
> _________________________________________________________________
> It's fast, it's easy and it's free. Get MSN Messenger today!
> http://www.msn.co.uk/messenger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org