• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

displaying table with JQgrid and Struts2

Posts: 20
MyEclipse IDE Windows XP Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!