Is there any way to define a default method for every in the action mapping of Struts-Config.XML file? If yes then how? Give a piece of code demonstrating the same.

Showing Answers 1 - 7 of 7 Answers

As far as my knowledge and experience is concern there is no way to have default method for all the Action Mappings. But what i can suggest you is try to define one interface with the default method declaration and implement in all the Action Forms in that way you can get a default method for all the ActionForm its just an idea.

   I accept your comments.

Thank you

abdul khalik

  • May 11th, 2006
 

Yeah we can write our own controller

  Was this answer useful?  Yes

Sony V George

  • Apr 4th, 2007
 

What i have to say is. If you are extending dispatch action then you can specify the method the request need to go. For every action we can specify like wise

  Was this answer useful?  Yes


use unknown = true tag in action tag of struts-config.xml.

With this, the action mapping will be defaulted if no matching path is found.

Eg:

<action-mappings>
<action path="/example"

             unknown="true"

             .......................

                 ...............

</action>

</action-mapping>.


There will be only one degault method in the action mappings.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions