actually you dont need to do that
i only do
action:
private Set<String> email;

public void setEmail(Set<String> email) {
  this.email = email;
}
jsp:

<input name="email" value="val1"/>
<input name="email" value="val2"/>
<input name="email" value="val3"/>
...

then struts will populate it for me

On Thu, Oct 22, 2009 at 1:12 PM, Marcelo Salhab Brogliato <
msbro...@vialink.com.br> wrote:

> Hi Steven,
> I know that Set usually don't have orders.
> But how do I fill my set?
> I tried email[0] because I implemented this setter: void setEmail(int
> index, String email), and it just ignored index.
> It was a test.
>
> thanks,
> msbrogli
>
>
>
> On Oct 22, 2009, at 2:56 AM, Steven Yang wrote:
>
>  Set usually dont have orders unless specifically implemented forif you
>> need
>>
>> to preserver order then use List
>> then email[0] will work
>>
>> On Thu, Oct 22, 2009 at 12:38 PM, Marcelo Salhab Brogliato <
>> msbro...@vialink.com.br> wrote:
>>
>>  I made some tests in a very simple application now and I got this
>>> results:
>>>
>>> <input type="text" name="cliente.email" />
>>> <input type="text" name="cliente.email" />
>>> <input type="text" name="cliente.email" />
>>>
>>> Will add these emails to my set.
>>> But how can I access the first one?
>>> I'm trying this:
>>>
>>> <s:textfield label="Email" name="mystringset" value="toArray()[0]" />
>>>
>>> But this is not evaluating attribute value. Why?
>>> I tried: mystringset.toArray()[0] but it also didn't work.
>>>
>>> thanks!
>>> msbrogli
>>>
>>>
>>> On Oct 22, 2009, at 12:46 AM, Marcelo Salhab Brogliato wrote:
>>>
>>> Hi,
>>>
>>>>
>>>> in my action I have a client object that has a Set<String> email.
>>>> In my http request, I have these data:
>>>> client.email[0] = 'a...@def.com'
>>>> client.email[1] = 'a...@b2.com'
>>>> client.email[2] = 'a...@b2.com'
>>>>
>>>> But I'm getting an error in ParametersInteceptor.
>>>>
>>>> I created these setters:
>>>>
>>>> public void setEmail(int index, String email)
>>>> public void setEmail(String[] email)
>>>> public void setEmail(Set<String> email)
>>>>
>>>> But I'm already getting an exception.
>>>>
>>>> What is the right way to do this?
>>>> Or this interceptor never fills a Set?
>>>>
>>>> thanks in advice,
>>>> msbrogli
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to