Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>EDIT: Please put a System.out.println("something"); on every if / else block to see exactly where are you passing; </p> <p>As a note, <a href="http://struts.apache.org/2.0.6/docs/how-do-we-get-access-to-the-session.html" rel="nofollow">the preferred way to get the session object</a> is to implement SessionAware, instead of using ActionContext;</p> <hr> <p>Does your JSON Action looks like this ? :</p> <p><a href="http://struts.jgeppert.com/struts2-jquery-showcase/index.action" rel="nofollow">http://struts.jgeppert.com/struts2-jquery-showcase/index.action</a></p> <p>(go to <code>More Widgets -&gt; Charts -&gt; JSON Action</code>, in the bottom right tab.</p> <pre><code>@ParentPackage(value = "showcase") public class JsonChartData extends ActionSupport { private static final long serialVersionUID = 6659512910595305843L; private List&lt;ListValue&gt; objList; private Map&lt;Double, Double&gt; doubleMap; @Actions( { @Action(value = "/json-chart-data", results = { @Result(name = "success", type = "json") }) }) public String execute() { objList = new ArrayList&lt;ListValue&gt;(); doubleMap = new TreeMap&lt;Double, Double&gt;(); Random generator = new Random(); for (int i = 1; i &lt;= 24; i++) { doubleMap.put(Double.valueOf("" + i), generator.nextDouble() * 10.0); } for (int i = 1; i &lt;= 24; i++) { objList.add(new ListValue("" + i, "" + generator.nextInt(30))); } return SUCCESS; } public String getJSON() { return execute(); } public List&lt;ListValue&gt; getObjList() { return objList; } public void setObjList(List&lt;ListValue&gt; objList) { this.objList = objList; } public Map&lt;Double, Double&gt; getDoubleMap() { return doubleMap; } public void setDoubleMap(Map&lt;Double, Double&gt; doubleMap) { this.doubleMap = doubleMap; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload