You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mansour <ma...@yahoo.com> on 2007/06/15 22:50:22 UTC

Type Conversion

I am trying to convert a string into an Object. I can not find 
documentation on how to implement the StrutsTypeConverter.
The documentation says:

To create a type converter one would need to extends StrutsTypeConverter.

public class MyConverter extends StrutsTypeConverter {
    public Object convertFromString(Map context, String[] values, Class toClass) {
       .....
    }

    public String convertToString(Map context, Object o) {
       .....
    }
 }



An no more details. This doesn't help. Same thing with the book starting 
struts2.
Any idea what are these parameters that are passed to the interface 
methods ?
How to use them ?


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


Re: Type Conversion

Posted by Dave Newton <ne...@yahoo.com>.
--- Mansour <ma...@yahoo.com> wrote:
> I am trying to convert a string into an Object. I
> can not find documentation on how to implement the
> StrutsTypeConverter. The documentation says:
> 
> To create a type converter one would need to extends
> StrutsTypeConverter.
> 
> public class MyConverter extends StrutsTypeConverter
> {
>     public Object convertFromString(Map context,
> String[] values, Class toClass) {
>        .....
>     }
> 
>     public String convertToString(Map context,
> Object o) {
>        .....
>     }
>  }
> 
> 
> 
> An no more details. This doesn't help. 

Did you look at the JavaDocs [1]? It actually does say
what the parameters are.

d.

[1]
http://struts.apache.org/2.0.8/struts2-core/apidocs/org/apache/struts2/util/StrutsTypeConverter.html



       
____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC

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