File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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 :
I agree. Here's the link:
subject: struts-config.xml file problem
It's not a secret anymore!