struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Vennel <vfpe...@yahoo.com>
Subject Re: <select> box not getting populated from ActionForm.
Date Tue, 23 Nov 2004 14:50:50 GMT
Thanks Corey. 

I found out what I had missed. I had to add this line
before calling mapping.findForwarding().

httpServletRequest.setAttribute(actionMapping.getAttribute(),
bForm);

Santosh, I hope this will work for you too.


Peter.

--- Corey Scott <corey.scott@gmail.com> wrote:

> Peter and Santosh,
> 
> Here is an example that I use to do the same thing:
> 
> My Action Class:
> public class ListBillingCodeAction extends Action
> {
>     public ActionForward execute(ActionMapping
> mapping, ActionForm form,
>         HttpServletRequest request,
> HttpServletResponse response)
>         throws Exception
>     {
>         // retrieve billing codes (List)
>         BillingCodeManager manager = new
> BillingCodeManager();
> 
>         // add the list of the request var (expose
> to jsp)
>         request.setAttribute("dataList",
> manager.recallAll());
> 
>         // return success
>         return mapping.findForward("success");
>     }
> }
> 
> 
> Fragment from my JSP
> <html:select property="intBillingCodeID"
> name="destBean">
>         <html:optionsCollection name="dataList"
> label="strBillingCode"
> value="intBillingCodeID" />
> </html:select>
> 
> I hope this helps..
> 
> -Corey
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message