Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

execute method in struts

 
Shruthi Sam
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In Action class, we will be overriding the execute method generally. My doubt is, can we have some other method instead of execute(), like some xyz() and is it possible to call this xyz() method instead of execute(). Is there any place where it is mentioned/mapped like we need to call execute in the Action class? Kindly clear my doubt.
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please specify in the heading of your post whether your question is about Struts 1 or Struts 2
!
 
Joachim Rohde
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the section "Action Methods" at http://struts.apache.org/2.0.14/docs/action-configuration.html
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are extending Actionsupport then you need to override that method...this is for struts-2
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pradeep Adibatla wrote:If you are extending Actionsupport then you need to override that method...this is for struts-2

That's not necessarily true at all; action mappings can specify the method to execute, and if dynamic method invocation is allowed you don't even need to map it explicitly.
 
Shruthi Sam
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
Pragati verma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shruthi Sam wrote:Hi,
In Action class, we will be overriding the execute method generally. My doubt is, can we have some other method instead of execute(), like some xyz() and is it possible to call this xyz() method instead of execute(). Is there any place where it is mentioned/mapped like we need to call execute in the Action class? Kindly clear my doubt.




[Pragati]Hi

In Action class, we will be overriding the execute method generally. My doubt is, can we have some other method instead of execute(), like some xyz() and is it possible to call this xyz() method instead of execute().mention method="xyz"in struts.xml file.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't that what I said?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic