aspose file tools*
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 Java 8 in Action this week in the Java 8 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2 if result type json and method defined then all methods get invoked
 
Similar Threads
Struts2 & validation [SOLVED]
struts2+json mapping issue...
Struts2 mapping query
File Uploader with a progress bar in Struts2
Struts2-json plugin not serializing action class to json