aspose file tools*
The moose likes Struts and the fly likes Struts 2 + Ajax response handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 + Ajax response handling" Watch "Struts 2 + Ajax response handling" New topic
Author

Struts 2 + Ajax response handling

Nick Sher
Ranch Hand

Joined: Nov 10, 2008
Posts: 78
Hi,

I am using Struts 2.1.6 and Tiles 2.0.x with Ajax. I have an action configuration which returns a tiles result. Now I want to use this action with AJAX. I am using the bind tag to generate a listener and update a div.

When the action executes it returns a tiles result and updates the div with the new content. However, all the action properties (any lists, objects and variables are lost, they are not displayed). When there is an error, only the error key is displayed and its description is not picked up from the resource bundle. This used to work without AJAX.

How can I fix this? When I looked at the data returned using 'afterNotifyTopics', it displays complete response HTML from server but I don't need all this. I just need some action properties back so that I can update the error message and data on the page.

Please help.


Nick
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts 2 + Ajax response handling