This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

execute method of ActionSupport Class

 
Girish Wakure
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone!!

I have created action class that extends the ActionSupport class.
for some navigation action i am using following code


do i need to write execute method here?

because it is giving me following error



I was under impression that once you extend ActionSupport Class then you need not write execute() method instead it calls execute() method of ActionSupport class.


Please correct me. where I am going wrong.

Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Action source?
 
Girish Wakure
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Action source?


I dont get it
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't either. Without the action source code how I can I help?
 
Girish Wakure
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here in this application I just want to go to another jsp page as you can see in action and result mapping
 
Girish Wakure
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is action class
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,girish
You dont need to mention the execute() method in struts.xml .
But if you want to call a particular method other than execute then you need to mention it in the struts.xml file.
 
Girish Wakure
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply.

I just had a look at source code of ActionSupport and Action classes &
I have noticed that ActionSupport class dosent have execute() method!!


So I think I need to write execute method i.e. when I am not mentioning any method in action tag in struts.xml
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is not correct; see the ActionSupport Javadocs.
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

No you are not required to put execute() in action tag in struts.xml.


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Raza: the only time you need to write an execute() method is if (a) you don't specify a different method in the mapping and (b) you're not extending ActionSupport.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah--I see you're using a non-S2 plugin. Its requirements may be different, and it may be looking *only* in the specified class for an execute() method: check its source; that's almost certainly the issue.
 
Girish Wakure
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry! I got my mistek.

but this dosent shows execute method so I got confused.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Er, that's a completely different class from a completely different framework for a completely different version of Struts.
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Newton.

Are you Talking about mentioning it in Struts.xml or Action class ?



 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Raza: I'm saying that you don't need to write an execute() method if you're extending ActionSupport (since it has a default implementation) or you specify the method to be executed in a config file.
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for confirmation newton !
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic