【发布时间】:2014-05-13 06:44:01
【问题描述】:
在行动:
//Declaration
JSONObject jObj1 = null;
public JSONObject getjObj1() {
return jObj1;
}
public void setjObj1(JSONObject jObj1) {
this.jObj1 = jObj1;
}
//In Action method
String jsong="{\"cid\":232}";
jObj1 = new JSONObject(jsong);
return Action.SUCCESS
Struts 配置文件:
<action name="jsonAction" class="jsonAction" method="getJson">
<result type="json" name="success">
<param name="root">jObj1</param>
</result>
</action>
当我在 JSP 控制台中看到时,我得到空结果
我哪里出错了?谢谢。
【问题讨论】:
-
为什么不使用 S2 提供的 JSON 插件??