[英]Generate Struts 2 JSON Output within Action Call
I'm currently working on making an Struts 2 Action call with a JSON response - I'd like to have the response be cache-able, which means I need to get the JSON generated within the code before the call is made. 我目前正在使用JSON响应进行Struts 2 Action调用-我希望该响应是可缓存的,这意味着我需要在调用之前获取代码内生成的JSON。 Something like this, within and action's execute() method: 在action的execute()方法中是这样的:
String json = this.getJSONOutput();
JSONCacheUtils.cache(hash, json);
Is there any way to do this using the Struts 2 JSON library? 有什么方法可以使用Struts 2 JSON库执行此操作吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.