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
1
vote
1 answer

Can struts2-json-plugin accept upper camel case parameters?

I'm using struts2(struts2-json-plugin) to handle Content-Type=application/json request, everything is fine where params style is lower camel case,like {"region":"China","version":"v4"}. But it can't work when params is upper camel case,like…
LodgeGong
  • 13
  • 2
1
vote
2 answers

How to convert the input name dot to json format in simple way?

I have used the struts json plugin and tried to convert the form data to json format to submit by ajax. I have two cases in the HTML

Long Ranger
  • 5,888
  • 8
  • 43
  • 72
1
vote
1 answer

Serialization issue with Struts2 JSON for jQuery-ui auto-complete

I'm attempting to use Struts2 JSON plugin to serialize a JSON for a jQuery-ui autocomplete AJAX call. The format is from: jQueryUI Docs An array of objects with label and value properties: [ { label: "Choice1", value: "value1" }, ... ] I have this…
khhaaannnnn
  • 144
  • 1
  • 17
1
vote
1 answer

how can we pass Struts2 action class to angularjs $http get

My goal is to display values as a list from a table to the model pop-up on the JSP page. action public class IcdAction extends ActionSupport { private List icdCodes; public String execute() throws MalformedURLException,…
1
vote
1 answer

Giving an empty json result while executing struts 2 action class

Im trying to retrieve data from DB using hibernate ORM and get the out-put as json result using Struts2. Everything work up to retrieving data from DB, but for the json result I get only {}. I think I have done something wrong with my coding. But…
Madushan Perera
  • 2,568
  • 2
  • 17
  • 36
1
vote
1 answer

Struts2 json return extra \ backward slash

My Struts2 is currently returning this: [{"pathlocation":"http:\/\/103.231.125.106\/nesos\/cartoon\/151020183506download.jpeg"}] I want this: [{"pathlocation":"http://103.231.125.106/nesos/cartoon/151026121150download.jpeg"}]
1
vote
1 answer

Ajax GET returned JSON object shows as [object, Object]

I am using Struts2 and ajax. Ajax get function returns a json. But, if I print the returned json using "alert" or console, it shows [object, Object]. I have used dataType:"json" in the ajax call too. Can someone please point out what could be…
user2805924
  • 95
  • 1
  • 1
  • 10
1
vote
1 answer

Getting JSON object from Java in Struts 2

I am trying to get response text from Java server using getJSON() jQuery method. Although, I can get response data when the Java class is simple format (String, List and Map), I could not get success data when using other Java object. The…
Aung Thet
  • 3,051
  • 3
  • 13
  • 18
1
vote
2 answers

Struts2 json and ajax integration is not working

Here I am trying into integrating Struts 2 with JSON ,jQuery and ajax It is calling to the action class but i am not getting json response. I have added all json plugin and json-defult in struts-xml Ajax function function callajax() { …
1
vote
1 answer

java.lang.AbstractMethodError: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.getClientInfo()Ljava/util/Properties;

In my project, I'm using double select box, but when running action, it is displaying following exception. I have tried such as: java.lang.IllegalStateException: getInputStream() has already been called for this request + Struts2 and JSON but…
1
vote
1 answer

There is no result type defined for type 'json' mapped with name 'success' using Struts 2 jQuery Grid

I'm trying to implement struts2-jquery grid tag in my application but I'm not familiar with JSON so have some trouble with this process. What is wrong? Original example uses annotation on action class @Result(name = "success", type = "json") but I'm…
andy007
  • 907
  • 1
  • 15
  • 41
1
vote
2 answers

Getting null value in Action from Ajax request in Struts 2

I am trying to send AJAX request to Action in which I am sending one parameter from JSP page. So my Action class is receiving the Ajax request but params which I am sending with AJAX class are null in Action class. This is My Action Class: public…
Hitesh
  • 59
  • 4
  • 15
1
vote
5 answers

$.getJSON not retrieving data from Struts 2 Action Class to JSP Page

I want to retrieve fields from Struts2 Action class in my jsp page. My JavaScript code of JSP is able to trigger it's action class, but not showing set field value from action class to jsp page on calling the Id of supposed element through…
1
vote
2 answers

How to pass JSON object to Struts2 tag

I am getting JSON object via ajax call using JQuery. JSON object contains list of model (i.e Bean) e.g List I am using struts2 json plugin. JSON object as a string looks as given…
Pravin Varpe
  • 188
  • 12
1
vote
1 answer

Generate Struts 2 JSON Output within Action Call

I'm currently working on making an Struts 2 Action call with a JSON response - I'd like to have the response be cache-able, which means I need to get the JSON generated within the code before the call is made. Something like this, within and…
jtyler
  • 1,055
  • 2
  • 15
  • 22