This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes Problem with ActionForm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with ActionForm" Watch "Problem with ActionForm" New topic
Author

Problem with ActionForm

Pramod Kumar
Ranch Hand

Joined: Oct 05, 2007
Posts: 40
I have a form bean class in a jar file and it is not extending ActionForm, Now I need to use that bean and need to write Action class to that. In struts-config.xml I have configured that bean and in Action class I wrote

User user = (User)form; and in eclipse it is showing error Cannot cast from ActionForm to User.

How can I solve this problem.
Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
You can't cast from an ActionForm to a bean or vo. You have to map the variables manually. Create a mapFormToXXXX method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with ActionForm