Re: dynamic casting in Action class

2006-07-26 Thread Andreas Hartmann
Ed Griebel wrote: > If you only need to get predefined variables, you can use Jakarta > BeanUtils or PropertyUtils on the object. For instance, with a form > bean ActionForm form: > > String val = BeanUtils.getProperty("someProperty"); > Object valAsOriginalClass = PropertyUtils.getProperty("someP

Re: dynamic casting in Action class

2006-07-26 Thread Ed Griebel
If you only need to get predefined variables, you can use Jakarta BeanUtils or PropertyUtils on the object. For instance, with a form bean ActionForm form: String val = BeanUtils.getProperty("someProperty"); Object valAsOriginalClass = PropertyUtils.getProperty("someProperty"); BeanUtils.setPrope

Re: dynamic casting in Action class

2006-07-26 Thread Andreas Hartmann
Gareth Evans wrote: > You can't do either of these things! Right. > > AFAIK you can't do dynamic casting in java, although in > java 5 you may be able to utilise the Class.cast method. I did it another way now: I try to do the fm's and catch a possible cast-exception. All needed values are stor

Re: dynamic casting in Action class

2006-07-26 Thread Gareth Evans
_as_string); Object obj = classDefinition.newInstance(); classDefinition afc = (obj)fm; Anil. -Original Message- From: Andreas Hartmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 26, 2006 1:47 PM To: user@struts.apache.org Subject: dynamic casting in Action class Hello! I've go

RE: dynamic casting in Action class

2006-07-26 Thread Anil Kumar T
, 2006 1:47 PM To: user@struts.apache.org Subject: dynamic casting in Action class Hello! I've got the following problem in an action-class: I dynamically want to retrieve the ActionForm class, which has been called before the Action-class. Statically, I do this with ActionFormClass afc = (a

dynamic casting in Action class

2006-07-26 Thread Andreas Hartmann
Hello! I've got the following problem in an action-class: I dynamically want to retrieve the ActionForm class, which has been called before the Action-class. Statically, I do this with ActionFormClass afc = (afc)fm; How is it done dynamically? I've got the String name of the desired Class-Name