File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Is it possible 2 add multiple formbeans in struts XML file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Is it possible 2 add multiple formbeans in struts XML file" Watch "Is it possible 2 add multiple formbeans in struts XML file" New topic
Author

Is it possible 2 add multiple formbeans in struts XML file

jo sim
Ranch Hand

Joined: Apr 24, 2006
Posts: 37
Q1)Hi is it possible to add multiple form beans in a struts xml file or there can only be one form-beans with multiple form-bean?

Q2) Also is it possible to have multiple action paths for one form bean.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

jo sim, "2" is not a word, it is a numeral. Please be sure to use real words such as "to" when posting to the forums.

Please read this for more information.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You can define as many form beans as you want in a struts-config.xml file. However, a single Action can only be associated with one form bean.

On the other hand, any number of Actions can use the same form bean.


Merrill
Consultant, Sima Solutions
jo sim
Ranch Hand

Joined: Apr 24, 2006
Posts: 37
(((You can define as many form beans as you want in a struts-config.xml file)))

Do you mean to say that one can have as many form-bean inside of form-beans? or one can have alot of form-beans with form-bean in it?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8142
    
  52

As per the Struts Config dtd, you can have only one form-beans at the most. This form-beans can then have multiple form-bean


[My Blog] [JavaRanch Journal]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Just to clarify what Jaikiran said: In the struts-config.xml file you can have only one <form-beans></form-beans> stanza, and inside it, you can have any number of <form-bean></form-bean> stanzas.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Is it possible 2 add multiple formbeans in struts XML file
 
Similar Threads
question about actionform
ValidatorActionForm Question?
Multiple Action Classes in one FormBean
org.apache.jasper.JasperException
Validation framework is not working