This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes struts2 if result type json and method defined then all methods get invoked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 if result type json and method defined then all methods get invoked" Watch "struts2 if result type json and method defined then all methods get invoked" New topic
Author

struts2 if result type json and method defined then all methods get invoked

Sumit King
Greenhorn

Joined: Nov 03, 2009
Posts: 7
I have an Action class with 4 action methods. All four action action methods use a json result.

Via logging statements and debugging, I have verified that if I call action method 1, action method 2 and 3 are also called. But not 4. Finally, action method 1 is called again and the json result is generated

If I change the result type of Action method 1 to the default dispatcher with a jsp location, only action method 1 is called. (this is the behavior I want with the json result) Hope that makes sense.

Anyone have any ideas?
This question was also asked here, not by me.
http://stackoverflow.com/questions/3767698/struts2-if-result-type-json-and-method-defined-then-all-methods-get-invoked

This is my question on SO.
http://stackoverflow.com/questions/6061709/struts2-action-being-called-twice-if-result-type-is-json

But there was no answer.
Please let me know if you need more information.
Sumit King
Greenhorn

Joined: Nov 03, 2009
Posts: 7
If anyone is wondering, this was answered on SO.

http://stackoverflow.com/questions/6061709/struts2-action-being-called-twice-if-result-type-is-json
 
 
subject: struts2 if result type json and method defined then all methods get invoked
 
Similar Threads
struts2+json mapping issue...
File Uploader with a progress bar in Struts2
Struts2 & validation [SOLVED]
Struts2 mapping query
Struts2-json plugin not serializing action class to json