• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

JSON Gridview is not working with struts2

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Sir,

I am trying to use <sjg> tag for displayiong table in grid view in strust2.

it is like, when the user do login it will come to welcome.jsp and on welcome.jsp i have put a link "PatientData" when the user click on it, he will get list of patients with name and code. but when I click on PatientData link i got following error in browser.

I am using struts2-core 2.3.4.jar, struts2-jquery-grid-pulgin3.5.1.jar and this lib are included in my project.




Temp1.java


CustomerData.java is GETTER SETTER method class, which will set person code and name.

Temp2.java


PatientData.jsp file content


Looking for your reply.
Untitled.png
[Thumbnail for Untitled.png]
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This has nothing to do with Swing. Moving this to the Struts forum.
 
Parth Pateld
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ranganathan Kaliyur Mannar wrote:This has nothing to do with Swing. Moving this to the Struts forum.



Hello Sir, Can I get reply for my post ?
 
Ranch Hand
Posts: 94
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Change your method name getServiceDetails , try not to use get*** in action method as many times it is found that they are called twice if result type is json.
2. Your are using result type json in wrong manner <result name="success" type="json">/jsp/PatientData.jsp</result> you can not treat it as a type dispatcher.refer this link Struts2-json-plugin-docs
 
Parth Pateld
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Yogesh Lonkar wrote:1. Change your method name getServiceDetails , try not to use get*** in action method as many times it is found that they are called twice if result type is json.
2. Your are using result type json in wrong manner <result name="success" type="json">/jsp/PatientData.jsp</result> you can not treat it as a type dispatcher.refer this link Struts2-json-plugin-docs



Hello Sir,

Thanks for your reply.
I am new to struts2 and I want to know how to redirect JSON data in jsp file.
If class ABC and its action name is abc and result type is json then i will get json formated data in abc.action in browser, but hoe to use that data into jsp file.
 
Yogesh Lonkar
Ranch Hand
Posts: 94
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In this situation create Getter and Setter for your bean gridBean and change result of action to
this way when patinetData action is called you will get json object in result. you can check Json object by directily calling /patinetData in browser for handling Json in Gridtag refere this GridTag Wiki
 
reply
    Bookmark Topic Watch Topic
  • New Topic