as mentioned in the email each of the values supplied in the values parameter 
is verified to be of type last parameter of toClass
class FuBar
{
}
class classDate extends java.util.Date
{
}
so if the parameter of values contains the string values 
{"classFuBar","classDate"} where toClass parameter is Date.class
validate classDate would validate correctly but classFuBar would NOT validate

the suggestion of using EnumTypeConverter would probably be the better 
converter to use 
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.


> Date: Mon, 4 Jul 2011 12:27:32 +0800
> Subject: Re: About StrutsTypeConverter
> From: vincent.lin...@gmail.com
> To: user@struts.apache.org
> 
> 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.len...@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...@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-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