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
You can't do either of these things! AFAIK you can't do dynamic casting in java, although in java 5 you may be able to utilise the Class.cast method. Gareth Anil Kumar T wrote: You got to include one more step as mentioned below. Class classDefinition = Class.forName(ClassName_as_string); Obj

RE: dynamic casting in Action class

2006-07-26 Thread Anil Kumar T
You got to include one more step as mentioned below. Class classDefinition = Class.forName(ClassName_as_string); Object obj = classDefinition.newInstance(); classDefinition afc = (obj)fm; Anil. -Original Message- From: Andreas Hartmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 26,