You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Dustin S." <ic...@gmail.com> on 2008/04/16 19:43:08 UTC

ParameterAware Arrays

I noticed the the map for setParameters is <String, String[]>. If I
intend to always only use [0], is there any easy way to accomplish
this without having to do [0] everytime I get() a parameter from the
map? I noticed there is SingleValueMap in webwork for this purpose.
Does something exist like this in Struts 2 or possibly is there any
easier way to get params from a url (page?parm1=value1&param2=value2)
that I am not seeing?

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


Re: ParameterAware Arrays

Posted by "Dustin S." <ic...@gmail.com>.
Hi Gabriel,

I just wanted to say that I ended up putting instance variables with
getters/setters for the request parameters (as you suggested). I
wasn't aware they auto-binded like that.

Thanks for your response.

Dustin.

On Wed, Apr 16, 2008 at 4:55 PM, Gabriel Belingueres
<be...@gmail.com> wrote:
> You can of course set up instance variables in your action class with
>  identical names as the parameters you intend to use.
>
>  2008/4/16, Dustin S. <ic...@gmail.com>:
>
>
> > I noticed the the map for setParameters is <String, String[]>. If I
>  > intend to always only use [0], is there any easy way to accomplish
>  > this without having to do [0] everytime I get() a parameter from the
>  > map? I noticed there is SingleValueMap in webwork for this purpose.
>  > Does something exist like this in Struts 2 or possibly is there any
>  > easier way to get params from a url (page?parm1=value1&param2=value2)
>  > that I am not seeing?
>  >
>  > ---------------------------------------------------------------------
>  > 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: ParameterAware Arrays

Posted by Gabriel Belingueres <be...@gmail.com>.
You can of course set up instance variables in your action class with
identical names as the parameters you intend to use.

2008/4/16, Dustin S. <ic...@gmail.com>:
> I noticed the the map for setParameters is <String, String[]>. If I
> intend to always only use [0], is there any easy way to accomplish
> this without having to do [0] everytime I get() a parameter from the
> map? I noticed there is SingleValueMap in webwork for this purpose.
> Does something exist like this in Struts 2 or possibly is there any
> easier way to get params from a url (page?parm1=value1&param2=value2)
> that I am not seeing?
>
> ---------------------------------------------------------------------
> 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