You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by pc leung <pi...@gmail.com> on 2006/01/10 15:47:36 UTC

how to retrieve the selected value of jsp in action class

The following is the dropdown box in jsp

<html:form action="setupAssignUserSystem.do" method="post" focus="engName">
            <html:select name="userForm" property="engName">
                <html:options collection="userList" property="engName"/>
            </html:select>


How to get the value selected in action class ?

Thanks

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


Re: how to retrieve the selected value of jsp in action class

Posted by pc leung <pi...@gmail.com>.
my case goes like this

inside SetupAssignUserSystemAction class,
it associates with another form,

	UserSystemForm userSystemForm = (UserSystemForm)form;
	userSystemForm.setMethod("create");

Can it be casted to "UserForm userForm = (UserForm )form;"
to get the value of previous page UserForm

And then cast it again "UserSystemForm userSystemForm =
(UserSystemForm)form;"  ?


My english is not good. hope you understand.


Thanks


On 1/11/06, Rick Reumann <st...@reumann.net> wrote:
> pc leung wrote the following on 1/10/2006 9:47 AM:
> > The following is the dropdown box in jsp
> >
> > <html:form action="setupAssignUserSystem.do" method="post" focus="engName">
> >             <html:select name="userForm" property="engName">
> >                 <html:options collection="userList" property="engName"/>
> >             </html:select>
> >
> >
> > How to get the value selected in action class ?
>
> Assuming UserForm is a standard ActionForm:
>
> UserForm userForm = (UserForm )form;
> String engName = userForm.getEngName();
>
> --
> Rick
>
> ---------------------------------------------------------------------
> 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: how to retrieve the selected value of jsp in action class

Posted by Rick Reumann <st...@reumann.net>.
pc leung wrote the following on 1/10/2006 9:47 AM:
> The following is the dropdown box in jsp
> 
> <html:form action="setupAssignUserSystem.do" method="post" focus="engName">
>             <html:select name="userForm" property="engName">
>                 <html:options collection="userList" property="engName"/>
>             </html:select>
> 
> 
> How to get the value selected in action class ?

Assuming UserForm is a standard ActionForm:

UserForm userForm = (UserForm )form;
String engName = userForm.getEngName();

-- 
Rick

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