Jquery Modal Forms with Struts 1.3

后端 未结 2 1094
慢半拍i
慢半拍i 2021-02-10 14:48

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

2条回答
  •  执念已碎
    2021-02-10 15:27

    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.

提交回复
热议问题