This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with ActionForm" Watch "Problem with ActionForm" New topic

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Problem with ActionForm
It's not a secret anymore!