File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes 1JSP File->2 Actions(2 ActionForms) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "1JSP File->2 Actions(2 ActionForms)" Watch "1JSP File->2 Actions(2 ActionForms)" New topic

1JSP File->2 Actions(2 ActionForms)

Fedor Smirnoff
Ranch Hand

Joined: Apr 21, 2003
Posts: 45
Well actually it would be

JSP File - > Action#1(ActionForm#1) -> Action#2(ActionForm#2)

I have been trying to figure this out for days with not much luck
I have a jsp file with one form in it that has a bunch of values. All those values are handled by 2 ActionForms. I am trying to submit this form and by redirecting from Action 1 to action 2 have those values populate ActionForm 1 and ActionForm 2. Unfortunately only first ActionForm being populated. If I first post to Action#1 than redirect to Action#2 than ActionForm#1 being populated. If I post to Action#2 than redirect to Action#1 than only ActionForm#2 being populated.

Any ideas? I am really stuck!

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If the two forms have properties of the same name, just use BeanUtils.CopyProperties() to copy from one to the other. Struts is designed to populate only one form bean on submission, so I don't think you'll have much luck trying to get Struts to populate both of them.

Consultant, Sima Solutions
I agree. Here's the link:
subject: 1JSP File->2 Actions(2 ActionForms)
It's not a secret anymore!