Multiple result types in Struts2?

前端 未结 3 1216
孤独总比滥情好
孤独总比滥情好 2021-01-25 15:35

I have a Struts2 application where I using Tiles. How can I get multiple result types in action-mappings? because I need to set de output as JSON data, and Tiles simultaneous. I

3条回答
  •  暖寄归人
    2021-01-25 15:52

    To my knowledge there is no way to return multiple things simultaneously. The browser will only be expecting one thing, either the JSON or the HTML once all the tiles stuff is done.

    I can think of two ways to do this: double request (one for each result type) or use one to generate the other (get the JSON and use JavaScript to construct the HTML on the client).

    What are you trying to accomplish that you need both results?

提交回复
热议问题