Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

execute method in struts

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Please specify in the heading of your post whether your question is about Struts 1 or Struts 2

!
 
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read the section "Action Methods" at http://struts.apache.org/2.0.14/docs/action-configuration.html
 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are extending Actionsupport then you need to override that method...this is for struts-2
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Isn't that what I said?
 
What? What, what, what? What what tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic