| Author |
Action Form Error
|
Reshma Reddy
Ranch Hand
Joined: Dec 21, 2006
Posts: 197
|
|
Hi to all, when i am trying to get from details in my action class i am getting this error //use NameFrom to get the request parameters NameForm nameForm = (NameForm)form; Error Message:Cannot cast from ActionForm to NameForm Please anybody tell me what's wrong in this line. Regards, vardhan
|
 |
Praveen Kumar
Ranch Hand
Joined: Nov 06, 2006
Posts: 133
|
|
Which action form you are using like ActionForm or DynoActionForm. If you user ActionForm, then ActionForm xxx=(ActionForm)form; if you are usinf DynoActioForm, DynaActionForm inForm = (DynaActionForm) form; Long IDId = (Long) inForm.get("Id"); This should help you.
|
 |
Reshma Reddy
Ranch Hand
Joined: Dec 21, 2006
Posts: 197
|
|
Hi kumar, i am using ActionFrom only (not using dynaActionFrom).i done same but still i am getting that error. Regards, vardhan
|
 |
Praveen Kumar
Ranch Hand
Joined: Nov 06, 2006
Posts: 133
|
|
Then paste your code here? Action element of that class(action in config )and Action class also . main snippet is enough.
|
 |
Raghavan Muthu
Ranch Hand
Joined: Apr 20, 2006
Posts: 3327
|
|
|
May be silly, but does your NameForm extends org.apache.struts.action.ActionForm?
|
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
|
 |
Reshma Reddy
Ranch Hand
Joined: Dec 21, 2006
Posts: 197
|
|
Hi, Thanks to all for giving replay i got the place where i done mistake. Regards, vardhan
|
 |
 |
|
|
subject: Action Form Error
|
|
|