aspose file tools*
The moose likes Struts and the fly likes JSON Gridview is not working with struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSON Gridview is not working with struts2" Watch "JSON Gridview is not working with struts2" New topic
Author

JSON Gridview is not working with struts2

Parth Pateld
Greenhorn

Joined: Nov 01, 2011
Posts: 29
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]

Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1096
    
  10

This has nothing to do with Swing. Moving this to the Struts forum.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Parth Pateld
Greenhorn

Joined: Nov 01, 2011
Posts: 29
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 ?
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

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


Learning some thing New Every Day
Parth Pateld
Greenhorn

Joined: Nov 01, 2011
Posts: 29
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

Joined: Jul 17, 2012
Posts: 94

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSON Gridview is not working with struts2