struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Lin <vincent.lin...@gmail.com>
Subject Re: About StrutsTypeConverter
Date Mon, 04 Jul 2011 04:27:32 GMT
I am confused that why the signature of convertFromString is
public Object convertFromString(Map context, String[] values, Class toClass)
instead of public Object convertFromString(Map context, String value,
Class toClass).

What's the point to pass a String array instead of a String argument
into this method?

Best Regards,
Vincent Lin

2011/7/3 Łukasz Lenart <lukasz.lenart@googlemail.com>:
> Take a look on EnumTypeConverter
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> Warszawa JUG conference - Confitura http://confitura.pl/
>
>
> 2011/7/2 Vincent Lin <vincent.lin.18@gmail.com>:
>> Hi!
>>
>> I have a questsion about StrutsTypeConverter.
>> It has 2 methods to be implemented:
>>
>> public Object convertFromString(Map context, String[] values, Class toClass) and
>> public String convertToString(Map context, Object o) .
>>
>> Why the second parameter in convertFromString String[] instead of String?
>> Does it mean struts will pass a array of String to converter when
>> there are multiple parameter with the same name in JSP?
>>
>> But in that case, how do we convert the object back to String[] when
>> the JSP is being rendered?
>>
>> Best Regards,
>> Vincent
>>
>> ---------------------------------------------------------------------
>> 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