• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question with respect to Struts2

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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??
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw this point after posting the Question

An action class may be associated with multiple actions.

Thanks David

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic