Hello. Could someone help me with struts2 and Json for the list of records be displayed on a jQgrid ?
The issue I am having is small, but painfull and I can't find how to fix it.
I inheritted an application written in Model 1 web application pattern and have converted it to using Struts 2. Now, have to change some GUI.
The is a JSP page (JSPFile1.jsp) that displays a gird using JQGrid, it displays it correctly with no problem. The URL for the grid goes to another JSP (JSP_JsonGetter2.jsp) and that JSP_JsonGetter2.jsp is nothing but a call to a server side static code that
1) makes call to database
2) builds a Json object from result set
structure of jsonObject is:
Now, this static method used the following to output the JsonObject:
This works fine.
When I created an Action class, where I did copy-pasted the code from that Static method, everything is OK, however the Json Object that comes from it looks like this (with excape \):
I happens the "result" variable in my action, is of type String (I do have getter and setter get/setResult()). Just an empty grid or page not rendered.
If I make it be of type JsonObject (use gson, google Json framework) I get an exception on a webpage .. which I can't understand.
Please, help with any advice?