You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andreas Hartmann <an...@freenet.de> on 2006/07/26 10:17:06 UTC
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 = (afc)fm;
How is it done dynamically? I've got the String name of the desired
Class-Name in an Hashtable. I tried it with reflection, but stuck:
Class classDefinition = Class.forName(ClassName_as_string);
classDefinition afc = (classDefinition)fm;
The last line gives the error:
cannot find symbol classDefinition
symbol : class classDefinition
Has anybody an idea, how to do it?
Thanks,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org