Questions tagged [struts2-json-plugin]

Struts2 JSON Plugin. The JSON plugin provides a JSON support for actions in Struts2.

In latest communication practice across almost all the cross platforms JSON is the best light weight technique.

Struts2-json-plugin provides a "json" result type that serializes actions into JSON. i.e. Whole object will be serialized into JSON format.

Official Documentation : http://struts.apache.org/2.2.3/docs/json-plugin.html

113 questions
2
votes
1 answer

Using JSON-RPC in Struts2

I use the following JavaScript/jQuery function to make a remote procedure call. var timeout; var…
Tiny
  • 27,221
  • 105
  • 339
  • 599
2
votes
1 answer

Excluding properties from JSON processing in Struts2

I have the following (full) entity class. public class StateTable implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) …
Tiny
  • 27,221
  • 105
  • 339
  • 599
2
votes
1 answer

How to get the request body in Struts2 when using struts2-json-plugin

I am using Struts2 and request.getInputStream() can't be used, since it gives error on 2nd use, first might have already being used by any of the interceptors. So, I believe there must be some way to get the request-body. But I didn't found anything…
coding_idiot
  • 13,526
  • 10
  • 65
  • 116
2
votes
2 answers

includeProperties not working?

struts.xml:
Siddharth Trikha
  • 2,648
  • 8
  • 57
  • 101
2
votes
2 answers

Ajax error struts2?

I have in my action class: try{ tspNameIdMap = slsReqMgmtCommonRemote.getTspNameIdMap(Integer.parseInt(circleId)); throw new ReqMgmtException("Message test"); } catch(ReqMgmtException rEx){ …
Siddharth Trikha
  • 2,648
  • 8
  • 57
  • 101
2
votes
0 answers

Struts 2 JSON interceptor for Custom Maps

I have following POJO's public class Category { private Integer id; private String title; private String description; //many more attributes below } public class User { private Integer id; private String name; …
hemantvsn
  • 1,316
  • 3
  • 12
  • 24
2
votes
0 answers

Struts2 JSON plugin includeProperties - not full regex support?

The documentation for Struts2 plugin version 2.3.x says that the includeProperties parameter can be set, and behaves as follows: A comma-delimited list of regular expressions can be passed to the JSON Result to restrict which properties will be…
Jeff Evans
  • 1,257
  • 1
  • 15
  • 31
2
votes
0 answers

struts2 jqgrid: onEditInlineErrorTopics not being called on error

On save of the jqgrid, the action catches a constraint violation exception and returns "error". However, the onEditInlineErrorTopics function is not called on the jsp. The exception needs to be translated to a user message saying "Duplicate…
2
votes
1 answer

Not able to render the response when using jQuery JSON format with Struts 2

I have a problem in loading the response to the select tag. I am trying to change the select Box based on the first one. For this I am using Struts 2 with jQuery Ajax tags. I think I have all required stuff but the response is not tagging to the…
Krish
  • 199
  • 1
  • 3
  • 8
2
votes
0 answers

Struts2 Json plugin response customization

I have some bean with properties. And json response is e.g. bean:[{"id":"1", "name":"Jack", "lastname":"Poter"}] Is there any ways in struts-json-plugin to convert response like this? bean:[{"id":"id", "value":"1"}, {"id":"name",…
2
votes
2 answers

Getting null value from struts/dojo datetimepicker in my struts 2 action?

I am using two struts/dojo datetimepicker in jsp page of my struts 2 web application. These allow to select date and displaying properly but when i submit the form and access the datetimepickers value in variables(with getter and setter) with same…
Sandeep vashisth
  • 1,040
  • 7
  • 20
  • 40
2
votes
0 answers

Trying to make ajax call, display Json data using jqgrid

I have following json-data, after an ajax call to struts2 action-class: {"jsonData":[{"age":1,"name":"Aifa"},{"age":2,"name":"Afraa"},{"age":27,"name":"Zafar"}],"searchId":0,"searchName":""} function setAjaxOutput() { …
Zafar
  • 105
  • 1
  • 2
  • 13
2
votes
2 answers

How to do partial page refresh using struts2-jquery plugin in struts2?

I want to do partial page refresh with the help of this. Take a scenario, we have a dropdown list according to select option of it, I want to refresh a div section of a page with data populated according to dropdown selection . How to do…
Vishu
  • 65
  • 3
  • 11
2
votes
2 answers

Struts2 REST plugin: Sending JSON object through PUT

I'm writing a RESTful service with Struts2 and the Struts2 REST plugin. Currently, my service is able to handle GET requests without issues, but I'm stuck trying to get it the "update" (PUT) request to work. I have two possible models, a List for…
shaunlim
  • 4,384
  • 6
  • 33
  • 38
2
votes
1 answer

Struts2 annotation with parameter when using json plugin

Simply I want to evaluate a property of my action and use it's value within an annotation. The following is exactly where I want to use it. I want to define a excludeProperties parameter at run time. Consider the following annotation which currently…
Quaternion
  • 10,380
  • 6
  • 51
  • 102