Thanks for the input. I got around the issue by changing my jsp to use the
html:optionsCollection tag.
<html:optionsCollection property="months" />
Seems to work now.
Thanks.
-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 25, 2005 8:01 PM
To: Struts Users Mailing List
Subject: Re: html:select drop downs using LabelValueBean
From: "Justin Moore" <[EMAIL PROTECTED]>
> I am havnig problems with the LabelValueBean in a drop down that is
suppose to show the months.
> I need to display the labels as strings (ex: Jan, Feb, etc). I need to
display their respective values
> as ordinals. When executing the code below, a JSP exception is thrown,
tellinng me:
> "cannot find bean under name months". Any idea what I am doing
incorrectly?
> <html:select property="myMonth">
> <html:options collection="months" labelProperty="label"
property="value" />
> </html:select>
I would leave the JSP as you have it, and move the ArrayList creation to a
ContextListener, placing 'months' in application scope. It's not as though
the list of months is going to change, doing all that object creation every
time a page is displayed is not necessary.
If you're going to leave it in the form, try property="months" instead of
collection="months". Check the docs, assuming your <html:select> is
surrounded by an <html:form> tag, it should call getMonths on the form bean.
IIRC, the collection attribute will make it go hunting in
page|request|session|application scope for something with that name.
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]