File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes execute method in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "execute method in struts" Watch "execute method in struts" New topic
Author

execute method in struts

Shruthi Sam
Ranch Hand

Joined: Jul 09, 2008
Posts: 73
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

Joined: Oct 08, 2009
Posts: 276
Please specify in the heading of your post whether your question is about Struts 1 or Struts 2
!


OCJP 6 (93%)
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

Read the section "Action Methods" at http://struts.apache.org/2.0.14/docs/action-configuration.html
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
If you are extending Actionsupport then you need to override that method...this is for struts-2
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jul 09, 2008
Posts: 73
Thank you.
Pragati verma
Greenhorn

Joined: Oct 02, 2010
Posts: 1
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

Joined: Sep 29, 2008
Posts: 12617

Isn't that what I said?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: execute method in struts