Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts action get method

 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there a way to set the struts action bean so that i works with the get method and not just the post?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'd have to check the submission type manually; there's nothing like that built in to either S1 or S2.
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where can i perform this check? It doesn't look there are any useful methods i can override for Action like i could on a servlet doPost, doGet.. other than execute. I don't think it even reaches that point if i try to submit using get.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In S1 I always used a base class that checked the submission type: since all my form submissions were POST back in those days that was okay, and I just called validate manually. In S2 I've used an interceptor to perform the same functionality.

(It's easier to say which version of Struts you're asking about, that way people don't have to guess or provide twice as much information as is probably needed.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic