struts2接受Ajax参数!
jquery Ajax参数形式:
var param1 = {"count":"102", "loginMemberId":"lyn"};
用我想在struts2 Action中通过Map<String, Object>类型接受。
我直接操作map.get("count"),就能取到102。
怎么实现,请高手帮忙!
[解决办法]
{"map.count":"102", "map.loginMemberId":"lyn"};
[解决办法]
那就SAMPLE下吧,
把JSON-LIB加到CLASSPATH里,然后ACTION里,
private String JSONRequest;private JSONObject jo = new JSONObject(); public void setJSONRequest(String JSONRequest){ this.JSONRequest = JSONRequest; } public String getJSONRequest(){ return JSONRequest; }public String execute(){ jo=JSONObject.fromObject(JSONRequest); jo.get("count"); return SUCCESS;}
[解决办法]
spring mvc