In Action:
//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 Cfg File :
<action name="jsonAction" class="jsonAction" method="getJson">
<result type="json" name="success">
<param name="root">jObj1</param>
</result>
</action>
I am getting empty result when I see in JSP console
Where I went wrong? Thanks.