This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Struts and the fly likes struts-config.xml file problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts-config.xml file problem" Watch "struts-config.xml file problem" New topic

struts-config.xml file problem

Shashidahanu Iyyanar
Ranch Hand

Joined: Jun 22, 2005
Posts: 37
In my project,I have the following scenario.I have a action class whose action forward path should make a call to a method in a dispatch action class.Is this possible in struts?For example,consider the following mapping in struts-config.xml:
<action path="/borrowerOperations" type="" parameter="submit">
<forward name="deleteBorrowers" path="/"/>
<forward name="saveBorrowers" path="/"/>

In the above example,the forward path named "deleteBorrowers" for the BorrowerOperationsAction class should make a call to the deleteBorrowers method of the dispatch action class represented by the path "/".
Is this possible?Is the action mapping for the given scenario represented correctly in the struts-config.xml?
Please reply to this as soon as possible.Thanks in advance.
sudhakar Tadepalli
Ranch Hand

Joined: Dec 27, 2001
Posts: 130
Yes. It is possible. You action call must extend DispatchAction class. and pass a parametername ex:method in struts config file.

Ex:<action path="/data" type="....."
name="dataForm" scope="session" parameter="method" validate="false" >
<forward name="list" path="/xyz.jsp" />


And you need to include method=edit in your URL or submit action and you should have a method name called edit in your action class.

Some usefull inks :
rocket mass heater kickstarter
subject: struts-config.xml file problem