wood burning stoves 2.0*
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

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

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

I agree. Here's the link: http://aspose.com/file-tools
subject: Question with respect to Struts2
Similar Threads
Struts2- About the return type on to the execute Method in Action class
Struts2 Annotations
Struts2: No configuration found for the specified action
Struts2 and Spring integration
Struts2 - Dependency Injection inside the Struts2 Action class