You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Howard Miller <me...@howardmiller.co.uk> on 2002/09/19 20:19:54 UTC

Using link to populate form bean

Hi,

How doI use a series of links to populate a form bean in Struts?

e.g., in a cgi I could do

<a href="next.cgi?param=1">Option1</a>
<a href="next.cgi?param=2">Option2</a>
<a href="next.cgi?param=3">Option3</a>

and I would just have to get the value of 'param' and that would be 
that. But how do I get the value of param into a form bean, as if I'd 
done it with a form and used radio buttons.

Howard Miller


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using link to populate form bean

Posted by Danny Mui <da...@muibros.com>.
formbeans and stuff populate from the request (either using get/posts). 
 using querystrings is simiar to a form get so beanutils.populate() 
looks for a method called setParam(...whatever datatype not too sure...) 
and puts 1, 2, or 3 into it.

So if  the action specified contains a formbean definition, the reset() 
method is called then it is populated with the request parameters, in 
this case param.

hope that helped :)

danny

Howard Miller wrote:

>Hi,
>
>How doI use a series of links to populate a form bean in Struts?
>
>e.g., in a cgi I could do
>
><a href="next.cgi?param=1">Option1</a>
><a href="next.cgi?param=2">Option2</a>
><a href="next.cgi?param=3">Option3</a>
>
>and I would just have to get the value of 'param' and that would be 
>that. But how do I get the value of param into a form bean, as if I'd 
>done it with a form and used radio buttons.
>
>Howard Miller
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>  
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>