aspose file tools*
The moose likes Struts and the fly likes Question with respect to Struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Question with respect to Struts2" Watch "Question with respect to Struts2" New topic
Author

Question with respect to Struts2

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528

Hello i am completely new to Struts2 .Please help

This is inside struts.xml file

<action name="Address_save" class="app.Address" method="save">

1. Why should one want to write a different method inside the Action class rather than execute method ?


2. Can i define both execute method and used defined method in a single Action class??


If you want something you never had do something which you had never done
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Because you might want to have multiple methods in your action class so functionality can be aggregated. Yes, you can have an arbitrary number of methods in your action classes with arbitrary names: the default "method" attribute value is "execute".
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
I saw this point after posting the Question

An action class may be associated with multiple actions.

Thanks David

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question with respect to Struts2