struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcelo Salhab Brogliato <msbro...@vialink.com.br>
Subject Re: Exception using ParametersInterceptor to fill a Set<String>
Date Thu, 22 Oct 2009 05:12:51 GMT
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 <
> msbrogli@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] = 'abc@def.com'
>>> client.email[1] = 'a1@b2.com'
>>> client.email[2] = 'a2@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-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


Mime
View raw message