I\'m builing a web application using Struts 1.3 for a class project, and I\'m having some problems with the AJAX compatibility of Struts 1.x (I hear 2.x is way better with AJAX
The backing framework really doesn't make much of a difference in terms of raw JavaScript/jQuery/Ajax.
You can return whatever you want from your Struts 1 action. If you want some JSON back like with a status or Flash message you can either write it directly to the response and return null
instead of an ActionForward
, or craft a JSP to have the content you want and set an appropriate header.
How the return value of the Ajax request is handled is all up to the client-side code: Struts 1 doesn't care what type of request it is; it will just spit back whatever it's configured to spit back.