• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with ActionForm

 
Pramod Kumar
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't cast from an ActionForm to a bean or vo. You have to map the variables manually. Create a mapFormToXXXX method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic