Mined Opinions For API: org.apache.struts

This tab contains all the opinions collected from Stack Overflow about the API. The other tabs present summaries of the opinions using different algorithms.
  • I picked up "Struts2 in action" book, which is quite all right but enough when the need comes to quickly solve few isues.. details
  • If you run your code without the compression part does it successfully pass the response?. details
  • By far, this is the best answer or suggested solution I found all around so far.. details
  • Thanks for all the possible stepss to track the issue.. details
  • 2.1.6!.. details
  • does it have any advantages over the first one you have mentioned......... details
  • By far, this is the best answer or suggested solution I found all around so far.. details
  • I picked up "Struts2 in action" book, which is quite all right but enough when the need comes to quickly solve few isues.. details
  • URL_http://www.jarvana.com/jarvana/view/org/apache/struts/struts2-json - plugin/2.1.8/struts2-json-plugin-2.1.8-javadoc.jar!/index.html.. details
  • hey do have any idea regarding this question URL_http://stackoverflow.com/questions/19361833/struts2-hibernate3-jasper - report-5-0-getting-blank-report............for so many days i'm searching for a solution to that.. details
  • Thank you, Roman.. details
  • hope this helps.. details
  • i have tried those parametes, and it seems that my JSON still trying to read the properties that missing !!. details
  • hey do have any idea regarding this question URL_http://stackoverflow.com/questions/19361833/struts2-hibernate3-jasper - report-5-0-getting-blank-report............for so many days i'm searching for a solution to that.. details
  • Please help me ... details
  • If any further information needed please let me know.. details
  • It works so try again.. details
  • Can anyone please tell me some solution for this CODESNIPPET_JAVA1 .. details
  • The code works fine, but i'm a bit confused and would like to know whether there is any other in struts2 in which we can achieve the same job, like using some other struts2 in-built method for HttpServletResponse.. details
  • Hi Betsey, and welcome to Stack Overflow.. details
  • Hi Betsey, and welcome to Stack Overflow.. details
  • Declare the field you'd like to return as JSON string like the field of your action, provide the getter and setter.. details
  • Thanks to the JSON Plugin the content type will be correct.. details
  • "JSON Plugin" documentation is here: URL_http://struts.apache.org/release/2.3.x/docs/json-plugin.html [ URL_http://struts.apache.org/release/2.3.x/docs/json-plugin.html ] .. details
  • Thanks, to whoever tried to help.. details
  • So in javascript would i still be able to do something like jsonString.data1 , jsonString.data2.. details
  • Not necessary, If you are using Struts 2 why not to use URL_http://code.google.com/p/struts2-jquery/ [struts2-jquery-plugin] and make grids more easier like described URL_http://code.google.com/p/struts2-jquery/wiki/GridTag [here] .. details
  • [empty grid]( URL_http://i.stack.imgur.com/gAfAx.jpg ) The line "console.log("data->results: "+data.results) ;"shows the Json in the browser JavaScript console, like this: CODESNIPPET_JAVA5 .. details
  • Thanks.. details
  • I am getting complete page, but empty grid:!. details
  • And then changing the JSP line with specifying data: to be like: CODESNIPPET_JAVA7 .. details
  • CODETERM5 is like this:** CODESNIPPET_JAVA2 .. details
  • Thank you.. details
  • Please, help me figure this out.. details
  • i have a form (displayed on the client) with several fields , and some fields are filled with JSON (like country List).. details
  • so i'm looking for a way to make my JSON class to ignore those properties, whose has to be treated on another Action CLASS!!!. details
  • Hey it works.. details
  • please check, if all of your struts2 plugin in the same version.. details
  • It returns something like this This is the data I want to return to the user CODESNIPPET_JAVA2 .. details
  • I believe that if I can get a Java String that contains the correct representation, that Mezzie's solution, below, will allow me to create the string with the correct encoding to put back into the JSON to serve back.. details
  • I'm not sure how to get the correct diacritical back.. details
  • So to clarify, if the JSON contains the string "Juan Guzmn", the Java String contains something like Juan Guzm?_An (I don't have the exact one in front of me).. details
  • See URL_http://struts.apache.org/2.x/docs/json-plugin.html#JSONPlugin- Excludingproperties [ URL_http://struts.apache.org/2.x/docs/json-plugin.html JSONPlugin-Excludingproperties] BTW if you going to use Hibernate#initialize method: Note: This only ensures intialization of a proxy object or collection; it is not guaranteed that the elements INSIDE the collection will be initialized/materialized.. details
  • Upon reading the URL_http://struts.apache.org/2.x/docs/json-plugin.html [JSON-plugin-guide] I realize the plugin might be expecting a JSON string instead of this query map, in which case I normally go with GSON instead.. details
  • So I create a sort model object like so to take the input: CODESNIPPET_JAVA3 .. details
  • Specially how will the JSON string have to look like?. details
  • Please ask any clarifications.. details
  • And the user class has properties like CODETERM2 etc.. details
  • in order to get this JSON object defined in the element _def_ This only works if _def_ isn't empty like in this example: CODESNIPPET_JAVA4 .. details
  • When _def_ is empty or not defined my program stops working on the line CODETERM1 and noticed that it doesn't continue the execution?!. details
  • I would expect it to return an empty JSONObject and continue the execution... What I want is to check if there is anything defined in _def_ and then in a if, else decide what to do in my program according to the value found there.... details
  • I've seen a lot of ways to register the provider with the Wink server, but not the Wink client.. details
  • If your response is JSON I would recommend using the struts2-json plugin URL_http://struts.apache.org/2.1.8/docs/json-plugin.html [ URL_http://struts.apache.org/2.1.8/docs/json-plugin.html ] and setting the enableGZIP param to true.. details
  • Any reference provided will be appreciated.. details
  • Thanks.. details
  • To be complete honest, I don't find the Spring integration all that compelling, which isn't really a big deal.Much like Spring MVC versus Struts, I'm not really expecting a lot of change with the Spring Rest JSON functionality, I'm just trying to figure out if it actually exists so I can try it out.. details
  • It works fine without compression but if I compress JSON responses, I can not see my JSON objects anymore.. details
  • For me, it looks like JQuery does not recognize the response as JSON because I am adding the Gzip compression.. details
  • Yes, everything works involving JSON works fine without the compression.. details
  • your package, which includes your action should extends json-default, struts2 2.1.6 have not integrated json plugin, you should include it by yourself on the classpath.. details
  • Oh, jeez sorry I remember solving something similar but didn't check the to see if it was the same OP.. details
  • I want to do an jQuery ajax submit with the data generated that will be converted to the Java List by Struts 2.. details
  • Struts 2 returns a whole action class with even request params!.. details
  • json-default?. details
  • I chosen Struts for this, because I got exposed to it in my J2EE exposure, but seems like it's hard to find consolidated knowledge available.. details
  • and yes , i'm using struts json plugin !!!. details
  • If you are using external lib to convert an object to JSON, then the plugin would have an addition argument to pass the include and exclude list.. details
  • If yes, it has include/exclude properties which can be configured in struts.xml.. details
  • Basically in your struts xml you extend from json-default instead of struts-default, then you return a result type of json.. details
  • You'd need to add a new forward for your action in Struts that directs to a JSP to generate the JSON instead of the standard JSP for your webpage.. details
  • There should be some issue with your XML File from where the control passes(**Eg: Struts.xml in case of Struts 2**) to the Action class.. details
  • If you are using some framework like Struts/Springs(**Which you should have mentioned**), check if the control is getting passed to your controller class, if the control is not getting passed.. details
  • Hi I am using JQgrid in my struts 2 web application ... details
  • In Struts 2 documentation, it is recommended to use ServletResponseAware .. details
  • Use the Struts URL_http://struts.apache.org/release/2.3.x/docs/json- plugin.html ["JSON-Plugin"] .. details
  • I was struggling with this for quite a while, thinking that the problems I am having is due to not understanding Jquery/gqgird/javascript, etc.While that may still be the case, I solved the issue of displaying the data, simply by not using google gson library, and serializing a custom java bean object that maps to my data.Maybe someone can find this useful, and won't have to spend as much time: The errors I was getting was due to fact that Struts json plugin uses reflection to find properties on an object to be serialized.. details
  • method, so deeply burried in struts-json-plugin there were JsonException caught, related to InvocationTargetException .. details
  • As a result, since JsonObject extends JsonElement from google library, struts sees the bunch of getter methods which it thinks are to be serialized.All the methods CODESNIPPET_JAVA1 .. details
  • @AndreiBrsan : 1 doubt, using this would convert the json object into string.. details
  • I added a quick method specifically for Struts 2.. details
  • I understand that it could be somehow incorrect, but do not know how.Also, I tried to have a results variable in the action as JsonObject (and changing the way it obtains a value to this) CODESNIPPET_JAVA6 .. details
  • JQgrid with Struts 2.. details
  • In struts json I can serialize all the properties using CODESNIPPET_JAVA2 .. details
  • I know that I can exclude properties.. details
  • How can I exclude a Base class from serialization process of struts json.. details
  • But I want to exclude a whole class from serializing.. details
  • Struts , JSON, Ignore some properties.. details
  • When I add struts2-json- plugin-2.1.8.1.jar the problems come while deploying.. details
  • I'm having trouble with a conflict when adding that jar.. details
  • Hi, you do need include json-default and which verson of struts2 are you using?. details
  • Nope the struts property is still null.. details
  • I wonder if there's any struts configuration I need to make.... details
  • I am currently creating a web-application where the users can fetch tags from the database as JSON, here is my struts action CODESNIPPET_JAVA1 .. details
  • It's a legacy application using Struts 1.3.8.. details
  • For your use case (Struts 2), a simple solution would be to place the CODETERM1 property in your CODETERM2 , then refer to it in the JSP page as follows: CODESNIPPET_JAVA2 .. details
  • I want to create a JSON object in java code and then pass it on to javascript/jquery for parsing(further processing).I am using Struts 2 framework.. details
  • I tried this Resource struts sonar.find(ResourceQuery.createForMetrics("int egrationContinue:integrationContinue", "coverage", "lines", "violations"));Measure s=struts.getMeasure("coverage");System.out.println(s.getData());.. details
  • The AJAX request being sent to the server follows the following format (GET query string): CODESNIPPET_JAVA1 .. details
  • I also tried to add the JSON interceptor, but I think I misunderstood its deserialization process, as explained in the edit.. details
  • or (non-escaped): CODESNIPPET_JAVA2 .. details
  • I also tried to add the JSON interceptor, but I think I misunderstood its deserialization process, as explained in the edit.. details
  • Is it possible to make struts populate the list by passing the appropriate JSON string, while submitting a jQuery ajax request pointed at that action.. details
  • If a struts 2 action class have a property of CODETERM1 .. details
  • I want to submit a AJAX request with JSON data which Struts 2 can use to automatically populate the List in the Action class.. details
  • Struts 2: Send a JSON string with JQuery ajax submit to be mapped into a List of complextypes.. details
  • EDIT : I'm sorry if I wasn't clear enough.. details
  • You can use a frameworks like struts to offload all of the transfer of values onto the framework.. details
  • That approach is used actually by popular Web MVC Frameworks like Struts and Spring MVC.. details
  • While running it on my server (struts & commons chains) it gives me back the following json response (after removing static) CODESNIPPET_JAVA3 .. details
  • If I put CODETERM2 try / catch block I get _JSONObject["def"] is not a JSONObject _ exception, but execution doesn't continue How does CODETERM3 behave???. details
  • If I put CODETERM2 try / catch block I get _JSONObject["def"] is not a JSONObject _ exception, but execution doesn't continue How does CODETERM3 behave???. details
  • I have a struts action receiving following JSON: CODESNIPPET_JAVA1 .. details
  • I would at this time remove the setters (I don't know if you have any spring magic that could cause weirdness), move the User creation into a prepare method and verify that the users are not null (see URL_http://struts.apache.org/2.0.14/docs/prepare-interceptor.html ) and this is just personal preference but @JSON(name="user") when applied to getUser is redundant so I would get rid of the @JSON annotations on the getters.. details
  • I would at this time remove the setters (I don't know if you have any spring magic that could cause weirdness), move the User creation into a prepare method and verify that the users are not null (see URL_http://struts.apache.org/2.0.14/docs/prepare-interceptor.html ) and this is just personal preference but @JSON(name="user") when applied to getUser is redundant so I would get rid of the @JSON annotations on the getters.. details
  • URL_http://stackoverflow.com/questions/4648288/problem-with-json-plugin-in- struts-2/4650575#4650575 [Problem-with-Json-plugin-in-Struts-2] Edit**:Here is an example of using exclude properties in an annotation which blocks the serialization of a nested member: CODESNIPPET_JAVA1 .. details
  • Problem with Json plugin in Struts 2.. details
  • Here's the error I receive when I try to run the Struts action: CODESNIPPET_JAVA2 .. details
  • Struts 2: how to send JSON to action.. details
  • It seems that it may be caused by the way I am sending JSON responses in my Struts Actions.. details
  • I was using the next code to send JSON responses in Struts web application.. details
Summaries the opinions about org.apache.struts using topic modeling.
  • 0. plugin struts2 def empty execution continue define program expect jsonstring: 21
    • hope this helps.. details
    • 2.1.6!.. details
    • - plugin/2.1.8/struts2-json-plugin-2.1.8-javadoc.jar!/index.html.. details
    • If any further information needed please let me know.. details
    • Please help me ... details
    • It works so try again.. details
    • The code works fine, but i'm a bit confused and would like to know whether there is any other in struts2 in which we can achieve the same job, like using some other struts2 in-built method for HttpServletResponse.. details
    • Thanks to the JSON Plugin the content type will be correct.. details
    • Thanks, to whoever tried to help.. details
    • So in javascript would i still be able to do something like jsonString.data1 , jsonString.data2.. details
    • And then changing the JSP line with specifying data: to be like: CODESNIPPET .. details
    • struts.xml is like this:** CODESNIPPET .. details
    • Thank you.. details
    • Thanks.. details
    • so i'm looking for a way to make my JSON class to ignore those properties, whose has to be treated on another Action CLASS!!!. details
    • i have a form (displayed on the client) with several fields , and some fields are filled with JSON (like country List).. details
    • please check, if all of your struts2 plugin in the same version.. details
    • Upon reading the JSON-plugin-guide I realize the plugin might be expecting a JSON string instead of this query map, in which case I normally go with GSON instead.. details
    • When _def_ is empty or not defined my program stops working on the line def and noticed that it doesn't continue the execution?!. details
    • I would expect it to return an empty JSONObject and continue the execution... What I want is to check if there is anything defined in _def_ and then in a if, else decide what to do in my program according to the value found there.... details
    • Thanks.. details
  • 1. compression response recognize add jquery gzip plugin compress involve documentation: 7
    • If you run your code without the compression part does it successfully pass the response?. details
    • "JSON Plugin" documentation is here: .. details
    • Specially how will the JSON string have to look like?. details
    • Please ask any clarifications.. details
    • It works fine without compression but if I compress JSON responses, I can not see my JSON objects anymore.. details
    • For me, it looks like JQuery does not recognize the response as JSON because I am adding the Gzip compression.. details
    • Yes, everything works involving JSON works fine without the compression.. details
  • 2. def wink empty lot provider define register order mention hey: 4
    • does it have any advantages over the first one you have mentioned......... details
    • Hey it works.. details
    • in order to get this JSON object defined in the element _def_ This only works if _def_ isn't empty like in this example: CODESNIPPET .. details
    • I've seen a lot of ways to register the provider with the Wink server, but not the Wink client.. details
  • 3. collection initialize excludingproperties materialize intialization inside note jsonplugin proxy hibernate: 3
    • Hi Betsey, and welcome to Stack Overflow.. details
    • Please, help me figure this out.. details
    • See Excludingproperties [ JSONPlugin-Excludingproperties BTW if you going to use Hibernate#initialize method: Note: This only ensures intialization of a proxy object or collection; it is not guaranteed that the elements INSIDE the collection will be initialized/materialized.. details
  • 4. return plugin specially solution diacritical struts2 property provide clarification compression: 1
    • It returns something like this This is the data I want to return to the user CODESNIPPET .. details
  • 5. console grid empty log browser userlist property provide plugin hey: 3
    • [empty grid]( ) The line "console.log("data->results: "+data.results) ;"shows the Json in the browser JavaScript console, like this: CODESNIPPET .. details
    • And the user class has properties like List<User> userList etc.. details
    • Any reference provided will be appreciated.. details
  • 6. spring complete response find solution plugin figure expect lot change: 7
    • By far, this is the best answer or suggested solution I found all around so far.. details
    • Can anyone please tell me some solution for this CODESNIPPET .. details
    • Declare the field you'd like to return as JSON string like the field of your action, provide the getter and setter.. details
    • I am getting complete page, but empty grid:!. details
    • I'm not sure how to get the correct diacritical back.. details
    • If your response is JSON I would recommend using the struts2-json plugin and setting the enableGZIP param to true.. details
    • To be complete honest, I don't find the Spring integration all that compelling, which isn't really a big deal.Much like Spring MVC versus Struts, I'm not really expecting a lot of change with the Spring Rest JSON functionality, I'm just trying to figure out if it actually exists so I can try it out.. details
  • 7. struts2 pick book solve isues specially solution property plugin roman: 1
    • I picked up "Struts2 in action" book, which is quite all right but enough when the need comes to quickly solve few isues.. details
  • 8. juan solution property representation guzm exact create encoding front guzmn: 4
    • Thanks for all the possible stepss to track the issue.. details
    • i have tried those parametes, and it seems that my JSON still trying to read the properties that missing !!. details
    • So to clarify, if the JSON contains the string "Juan Guzmn", the Java String contains something like Juan Guzm?_An (I don't have the exact one in front of me).. details
    • I believe that if I can get a Java String that contains the correct representation, that Mezzie's solution, below, will allow me to create the string with the correct encoding to put back into the JSON to serve back.. details
  • 9. report hey solution struts2 plugin blank search question idea jquery: 4
    • hey do have any idea regarding this question - report-5-0-getting-blank-report............for so many days i'm searching for a solution to that.. details
    • Thank you, Roman.. details
    • Not necessary, If you are using Struts 2 why not to use struts2-jquery-plugin and make grids more easier like described here .. details
    • So I create a sort model object like so to take the input: CODESNIPPET .. details
  • 0. create exclude property serialize send plugin edit block nest member: 12
    • I understand that it could be somehow incorrect, but do not know how.Also, I tried to have a results variable in the action as JsonObject (and changing the way it obtains a value to this) CODESNIPPET .. details
    • I know that I can exclude properties.. details
    • But I want to exclude a whole class from serializing.. details
    • In struts json I can serialize all the properties using CODESNIPPET .. details
    • Struts , JSON, Ignore some properties.. details
    • I wonder if there's any struts configuration I need to make.... details
    • I am currently creating a web-application where the users can fetch tags from the database as JSON, here is my struts action CODESNIPPET .. details
    • I want to create a JSON object in java code and then pass it on to javascript/jquery for parsing(further processing).I am using Struts 2 framework.. details
    • struts-2/4650575#4650575 [Problem-with-Json-plugin-in-Struts-2] Edit**:Here is an example of using exclude properties in an annotation which blocks the serialization of a nested member: CODESNIPPET .. details
    • Struts 2: how to send JSON to action.. details
    • It seems that it may be caused by the way I am sending JSON responses in my Struts Actions.. details
    • I was using the next code to send JSON responses in Struts web application.. details
  • 1. ajax request follow receive property send exclude include query format: 6
    • Oh, jeez sorry I remember solving something similar but didn't check the to see if it was the same OP.. details
    • If yes, it has include/exclude properties which can be configured in struts.xml.. details
    • The AJAX request being sent to the server follows the following format (GET query string): CODESNIPPET .. details
    • I want to submit a AJAX request with JSON data which Struts 2 can use to automatically populate the List in the Action class.. details
    • I have a struts action receiving following JSON: CODESNIPPET .. details
    • Here's the error I receive when I try to run the Struts action: CODESNIPPET .. details
  • 2. jsonobject find plugin property serialize def result extend jquery solve: 10
    • Basically in your struts xml you extend from json-default instead of struts-default, then you return a result type of json.. details
    • I chosen Struts for this, because I got exposed to it in my J2EE exposure, but seems like it's hard to find consolidated knowledge available.. details
    • json-default?. details
    • Use the Struts plugin.html ["JSON-Plugin"] .. details
    • I was struggling with this for quite a while, thinking that the problems I am having is due to not understanding Jquery/gqgird/javascript, etc.While that may still be the case, I solved the issue of displaying the data, simply by not using google gson library, and serializing a custom java bean object that maps to my data.Maybe someone can find this useful, and won't have to spend as much time: The errors I was getting was due to fact that Struts json plugin uses reflection to find properties on an object to be serialized.. details
    • As a result, since JsonObject extends JsonElement from google library, struts sees the bunch of getter methods which it thinks are to be serialized.All the methods CODESNIPPET .. details
    • Nope the struts property is still null.. details
    • It's a legacy application using Struts 1.3.8.. details
    • If a struts 2 action class have a property of type="json" .. details
    • If I put "def":"" try / catch block I get _JSONObject["def"] is not a JSONObject _ exception, but execution doesn't continue How does JSONObject.getJsonObject(String) behave???. details
  • 3. property add edit follow case place jsp solution simple jsonstring: 3
    • For your use case (Struts 2), a simple solution would be to place the jsonString property in your Action , then refer to it in the JSP page as follows: CODESNIPPET .. details
    • I also tried to add the JSON interceptor, but I think I misunderstood its deserialization process, as explained in the edit.. details
    • EDIT : I'm sorry if I wasn't clear enough.. details
  • 4. pass control exclude request property plugin spring remove setter getters: 8
    • If you are using external lib to convert an object to JSON, then the plugin would have an addition argument to pass the include and exclude list.. details
    • Struts 2 returns a whole action class with even request params!.. details
    • If you are using some framework like Struts/Springs(**Which you should have mentioned**), check if the control is getting passed to your controller class, if the control is not getting passed.. details
    • There should be some issue with your XML File from where the control passes(**Eg: Struts.xml in case of Struts 2**) to the Action class.. details
    • or (non-escaped): CODESNIPPET .. details
    • Is it possible to make struts populate the list by passing the appropriate JSON string, while submitting a jQuery ajax request pointed at that action.. details
    • You can use a frameworks like struts to offload all of the transfer of values onto the framework.. details
    • I would at this time remove the setters (I don't know if you have any spring magic that could cause weirdness), move the User creation into a prepare method and verify that the users are not null (see ) and this is just personal preference but @JSON(name="user") when applied to getUser is redundant so I would get rid of the @JSON annotations on the getters.. details
  • 5. process exclude base jqgrid property plugin receive send add edit: 3
    • Hi I am using JQgrid in my struts 2 web application ... details
    • JQgrid with Struts 2.. details
    • How can I exclude a Base class from serialization process of struts json.. details
  • 6. include plugin coverage struts2 send find println getdata violations getmeasure: 5
    • your package, which includes your action should extends json-default, struts2 2.1.6 have not integrated json plugin, you should include it by yourself on the classpath.. details
    • method, so deeply burried in struts-json-plugin there were JsonException caught, related to InvocationTargetException .. details
    • Hi, you do need include json-default and which verson of struts2 are you using?. details
    • I tried this Resource struts sonar.find(ResourceQuery.createForMetrics("int egrationContinue:integrationContinue", "coverage", "lines", "violations"));Measure s=struts.getMeasure("coverage");System.out.println(s.getData());.. details
    • Struts 2: Send a JSON string with JQuery ajax submit to be mapped into a List of complextypes.. details
  • 7. jsp mvc add response standard generate webpage forward direct follow: 3
    • You'd need to add a new forward for your action in Struts that directs to a JSP to generate the JSON instead of the standard JSP for your webpage.. details
    • That approach is used actually by popular Web MVC Frameworks like Struts and Spring MVC.. details
    • While running it on my server (struts & commons chains) it gives me back the following json response (after removing static) CODESNIPPET .. details
  • 8. jquery ajax submit generate add documentation servletresponseaware quick andreibrsan property: 4
    • I want to do an jQuery ajax submit with the data generated that will be converted to the Java List by Struts 2.. details
    • In Struts 2 documentation, it is recommended to use ServletResponseAware .. details
    • @AndreiBrsan : 1 doubt, using this would convert the json object into string.. details
    • I added a quick method specifically for Struts 2.. details
  • 9. plugin add struts2 deploy property jqgrid send receive edit serialize: 4
    • and yes , i'm using struts json plugin !!!. details
    • When I add struts2-json- plugin-2.1.8.1.jar the problems come while deploying.. details
    • I'm having trouble with a conflict when adding that jar.. details
    • Problem with Json plugin in Struts 2.. details
Summaries of the opinions about org.apache.struts using three algorithms (Textrank, Lexrank and Luhn) adopted from extractive summarization. Each algorithm was used once for the positive opinions and once for the negative opinions.
  • in order to get this JSON object defined in the element def This only works if def isn't empty like in this example: CODESNIPPET JAVA4 .
  • please check, if all of your struts2 plugin in the same version .
  • struts.xml is like this:** CODESNIPPET JAVA2 .
  • I believe that if I can get a Java String that contains the correct representation, that Mezzie's solution, below, will allow me to create the string with the correct encoding to put back into the JSON to serve back .
  • The code works fine, but i'm a bit confused and would like to know whether there is any other in struts2 in which we can achieve the same job, like using some other struts2 in built method for HttpServletResponse .
  • Can anyone please tell me some solution for this CODESNIPPET JAVA1 .
  • Thanks to the JSON Plugin the content type will be correct .
  • It returns something like this This is the data I want to return to the user CODESNIPPET JAVA2 .
  • i have tried those parametes, and it seems that my JSON still trying to read the properties that missing !!.
  • If your response is JSON I would recommend using the struts2 json plugin and setting the enableGZIP param to true .
  • I've seen a lot of ways to register the provider with the Wink server, but not the Wink client .
  • I would expect it to return an empty JSONObject and continue the execution What I want is to check if there is anything defined in def and then in a if, else decide what to do in my program according to the value found there .
  • So to clarify, if the JSON contains the string "Juan Guzmn", the Java String contains something like Juan Guzm?
  • I believe that if I can get a Java String that contains the correct representation, that Mezzie's solution, below, will allow me to create the string with the correct encoding to put back into the JSON to serve back .
  • The code works fine, but i'm a bit confused and would like to know whether there is any other in struts2 in which we can achieve the same job, like using some other struts2 in built method for HttpServletResponse .
  • Upon reading the JSON plugin guide I realize the plugin might be expecting a JSON string instead of this query map, in which case I normally go with GSON instead .
  • It returns something like this This is the data I want to return to the user CODESNIPPET JAVA2 .
  • Declare the field you'd like to return as JSON string like the field of your action, provide the getter and setter .
  • If your response is JSON I would recommend using the struts2 json plugin and setting the enableGZIP param to true .
  • To be complete honest, I don't find the Spring integration all that compelling, which isn't really a big deal Much like Spring MVC versus Struts, I'm not really expecting a lot of change with the Spring Rest JSON functionality, I'm just trying to figure out if it actually exists so I can try it out .
  • I would expect it to return an empty JSONObject and continue the execution What I want is to check if there is anything defined in def and then in a if, else decide what to do in my program according to the value found there .
  • in order to get this JSON object defined in the element def This only works if def isn't empty like in this example: CODESNIPPET JAVA4 .
  • When def is empty or not defined my program stops working on the line def and noticed that it doesn't continue the execution?!.
  • empty grid]( ) The line "console log("data >results: " data results) ;"shows the Json in the browser JavaScript console, like this: CODESNIPPET JAVA5 .
  • I believe that if I can get a Java String that contains the correct representation, that Mezzie's solution, below, will allow me to create the string with the correct encoding to put back into the JSON to serve back .
  • The code works fine, but i'm a bit confused and would like to know whether there is any other in struts2 in which we can achieve the same job, like using some other struts2 in built method for HttpServletResponse .
  • See Excludingproperties JSONPlugin Excludingproperties BTW if you going to use Hibernate#initialize method: Note: This only ensures intialization of a proxy object or collection; it is not guaranteed that the elements INSIDE the collection will be initialized materialized .
  • It returns something like this This is the data I want to return to the user CODESNIPPET JAVA2 .
  • Declare the field you'd like to return as JSON string like the field of your action, provide the getter and setter .
  • To be complete honest, I don't find the Spring integration all that compelling, which isn't really a big deal Much like Spring MVC versus Struts, I'm not really expecting a lot of change with the Spring Rest JSON functionality, I'm just trying to figure out if it actually exists so I can try it out .
  • In struts json I can serialize all the properties using CODESNIPPET JAVA2 .
  • There should be some issue with your XML File from where the control passes(**Eg: Struts xml in case of Struts 2**) to the Action class .
  • If a struts 2 action class have a property of type="json" .
  • I want to submit a AJAX request with JSON data which Struts 2 can use to automatically populate the List in the Action class .
  • Hi, you do need include json default and which verson of struts2 are you using?.
  • I was struggling with this for quite a while, thinking that the problems I am having is due to not understanding Jquery gqgird javascript, etc While that may still be the case, I solved the issue of displaying the data, simply by not using google gson library, and serializing a custom java bean object that maps to my data Maybe someone can find this useful, and won't have to spend as much time: The errors I was getting was due to fact that Struts json plugin uses reflection to find properties on an object to be serialized .
  • I understand that it could be somehow incorrect, but do not know how Also, I tried to have a results variable in the action as JsonObject (and changing the way it obtains a value to this) CODESNIPPET JAVA6 .
  • For your use case (Struts 2), a simple solution would be to place the jsonString property in your Action , then refer to it in the JSP page as follows: CODESNIPPET JAVA2 .
  • It seems that it may be caused by the way I am sending JSON responses in my Struts Actions .
  • I would at this time remove the setters (I don't know if you have any spring magic that could cause weirdness), move the User creation into a prepare method and verify that the users are not null (see ) and this is just personal preference but @JSON(name="user") when applied to getUser is redundant so I would get rid of the @JSON annotations on the getters .
  • You'd need to add a new forward for your action in Struts that directs to a JSP to generate the JSON instead of the standard JSP for your webpage .
  • I want to submit a AJAX request with JSON data which Struts 2 can use to automatically populate the List in the Action class .
  • I was struggling with this for quite a while, thinking that the problems I am having is due to not understanding Jquery gqgird javascript, etc While that may still be the case, I solved the issue of displaying the data, simply by not using google gson library, and serializing a custom java bean object that maps to my data Maybe someone can find this useful, and won't have to spend as much time: The errors I was getting was due to fact that Struts json plugin uses reflection to find properties on an object to be serialized .
  • I understand that it could be somehow incorrect, but do not know how Also, I tried to have a results variable in the action as JsonObject (and changing the way it obtains a value to this) CODESNIPPET JAVA6 .
  • I want to create a JSON object in java code and then pass it on to javascript jquery for parsing(further processing) I am using Struts 2 framework .
  • For your use case (Struts 2), a simple solution would be to place the jsonString property in your Action , then refer to it in the JSP page as follows: CODESNIPPET JAVA2 .
  • I also tried to add the JSON interceptor, but I think I misunderstood its deserialization process, as explained in the edit .
  • If you are using external lib to convert an object to JSON, then the plugin would have an addition argument to pass the include and exclude list .
  • I would at this time remove the setters (I don't know if you have any spring magic that could cause weirdness), move the User creation into a prepare method and verify that the users are not null (see ) and this is just personal preference but @JSON(name="user") when applied to getUser is redundant so I would get rid of the @JSON annotations on the getters .
  • struts 2 4650575#4650575 Problem with Json plugin in Struts 2 Edit**:Here is an example of using exclude properties in an annotation which blocks the serialization of a nested member: CODESNIPPET JAVA1 .
  • If you are using some framework like Struts Springs(**Which you should have mentioned**), check if the control is getting passed to your controller class, if the control is not getting passed .
  • There should be some issue with your XML File from where the control passes(**Eg: Struts xml in case of Struts 2**) to the Action class .
  • You'd need to add a new forward for your action in Struts that directs to a JSP to generate the JSON instead of the standard JSP for your webpage .
  • I want to submit a AJAX request with JSON data which Struts 2 can use to automatically populate the List in the Action class .
  • I was struggling with this for quite a while, thinking that the problems I am having is due to not understanding Jquery gqgird javascript, etc While that may still be the case, I solved the issue of displaying the data, simply by not using google gson library, and serializing a custom java bean object that maps to my data Maybe someone can find this useful, and won't have to spend as much time: The errors I was getting was due to fact that Struts json plugin uses reflection to find properties on an object to be serialized .
  • I understand that it could be somehow incorrect, but do not know how Also, I tried to have a results variable in the action as JsonObject (and changing the way it obtains a value to this) CODESNIPPET JAVA6 .
  • I want to create a JSON object in java code and then pass it on to javascript jquery for parsing(further processing) I am using Struts 2 framework .
  • For your use case (Struts 2), a simple solution would be to place the jsonString property in your Action , then refer to it in the JSP page as follows: CODESNIPPET JAVA2 .
  • If you are using external lib to convert an object to JSON, then the plugin would have an addition argument to pass the include and exclude list .
  • I would at this time remove the setters (I don't know if you have any spring magic that could cause weirdness), move the User creation into a prepare method and verify that the users are not null (see ) and this is just personal preference but @JSON(name="user") when applied to getUser is redundant so I would get rid of the @JSON annotations on the getters .
Summaries of the opinions about org.apache.struts using Opinosis, an abstractive summarizer of opinions..
  • web application .
  • struts action .
  • whole class .
Summaries of the opinions about org.apache.struts using contrastive viewpoints. Each entry contains a pair of positive and negative sentences that are most likely discussing about similar API features.
    • plugin 2 1 8 struts2 json plugin 2 1 8 javadoc jar! index html .
    • I wonder if there's any struts configuration I need to make .
    • please check, if all of your struts2 plugin in the same version .
    • I wonder if there's any struts configuration I need to make .
Summaries of opinions about based on specific API aspects, such as, performance, usability, etc. The 'Overview' page provides an overview of the aspects detected in the opinions. The 'Trend' page shows the distribution of polarity over time for each aspect. The 'Positive Opinions' page groups positive opinions by the detected aspects. The 'Contrastive By Aspect' page shows paris of contrastive opinions under each aspect (where found).
Features:
  • Thanks for all the possible stepss to track the issue.
  • json-default?
Documentation:
  • hey do have any idea regarding this question URL_http://stackoverflow.com/questions/19361833/struts2-hibernate3-jasper - report-5-0-getting-blank-report............for so many days i'm searching for a solution to that.
  • I would at this time remove the setters (I don't know if you have any spring magic that could cause weirdness), move the User creation into a prepare method and verify that the users are not null (see URL_http://struts.apache.org/2.0.14/docs/prepare-interceptor.html ) and this is just personal preference but @JSON(name="user") when applied to getUser is redundant so I would get rid of the @JSON annotations on the getters.
Community:
  • hey do have any idea regarding this question URL_http://stackoverflow.com/questions/19361833/struts2-hibernate3-jasper - report-5-0-getting-blank-report............for so many days i'm searching for a solution to that.
  • N/A
Onlysentiment:
  • Thank you, Roman.
  • EDIT : I'm sorry if I wasn't clear enough.
Bug:
  • N/A
  • I also tried to add the JSON interceptor, but I think I misunderstood its deserialization process, as explained in the edit.
Usability:
  • By far, this is the best answer or suggested solution I found all around so far.
  • If yes, it has include/exclude properties which can be configured in struts.xml.
  • Onlysentiment: 7
    1. general: 7
      • By far, this is the best answer or suggested solution I found all around so far.. details
      • Thank you, Roman.. details
      • Thanks.. details
      • I am getting complete page, but empty grid:!. details
      • Thank you.. details
      • Please, help me figure this out.. details
      • Thanks.. details
  • Documentation: 2
    1. general: 2
      • hey do have any idea regarding this question URL_http://stackoverflow.com/questions/19361833/struts2-hibernate3-jasper - report-5-0-getting-blank-report............for so many days i'm searching for a solution to that.. details
      • "JSON Plugin" documentation is here: URL_http://struts.apache.org/release/2.3.x/docs/json-plugin.html [ URL_http://struts.apache.org/release/2.3.x/docs/json-plugin.html ] .. details
  • Features: 18
    1. json: 4
      • Thanks to the JSON Plugin the content type will be correct.. details
      • [empty grid]( URL_http://i.stack.imgur.com/gAfAx.jpg ) The line "console.log("data->results: "+data.results) ;"shows the Json in the browser JavaScript console, like this: CODESNIPPET_JAVA5 .. details
      • Upon reading the URL_http://struts.apache.org/2.x/docs/json-plugin.html [JSON-plugin-guide] I realize the plugin might be expecting a JSON string instead of this query map, in which case I normally go with GSON instead.. details
      • Specially how will the JSON string have to look like?. details
    2. data: 1
      • It returns something like this This is the data I want to return to the user CODESNIPPET_JAVA2 .. details
    3. struts2: 1
      • please check, if all of your struts2 plugin in the same version.. details
    4. reference: 1
      • Any reference provided will be appreciated.. details
    5. general: 11
      • If you run your code without the compression part does it successfully pass the response?. details
      • Thanks for all the possible stepss to track the issue.. details
      • 2.1.6!.. details
      • does it have any advantages over the first one you have mentioned......... details
      • URL_http://www.jarvana.com/jarvana/view/org/apache/struts/struts2-json - plugin/2.1.8/struts2-json-plugin-2.1.8-javadoc.jar!/index.html.. details
      • Please help me ... details
      • If any further information needed please let me know.. details
      • Thanks, to whoever tried to help.. details
      • CODETERM5 is like this:** CODESNIPPET_JAVA2 .. details
      • I'm not sure how to get the correct diacritical back.. details
      • Please ask any clarifications.. details
  • Community: 4
    1. general: 4
      • I picked up "Struts2 in action" book, which is quite all right but enough when the need comes to quickly solve few isues.. details
      • hope this helps.. details
      • hey do have any idea regarding this question URL_http://stackoverflow.com/questions/19361833/struts2-hibernate3-jasper - report-5-0-getting-blank-report............for so many days i'm searching for a solution to that.. details
      • Hi Betsey, and welcome to Stack Overflow.. details
  • Usability: 28
    1. object: 2
      • See URL_http://struts.apache.org/2.x/docs/json-plugin.html#JSONPlugin- Excludingproperties [ URL_http://struts.apache.org/2.x/docs/json-plugin.html JSONPlugin-Excludingproperties] BTW if you going to use Hibernate#initialize method: Note: This only ensures intialization of a proxy object or collection; it is not guaranteed that the elements INSIDE the collection will be initialized/materialized.. details
      • So I create a sort model object like so to take the input: CODESNIPPET_JAVA3 .. details
    2. jsonobject: 1
      • I would expect it to return an empty JSONObject and continue the execution... What I want is to check if there is anything defined in _def_ and then in a if, else decide what to do in my program according to the value found there.... details
    3. javascript: 1
      • So in javascript would i still be able to do something like jsonString.data1 , jsonString.data2.. details
    4. struts2: 1
      • The code works fine, but i'm a bit confused and would like to know whether there is any other in struts2 in which we can achieve the same job, like using some other struts2 in-built method for HttpServletResponse.. details
    5. general: 10
      • By far, this is the best answer or suggested solution I found all around so far.. details
      • I picked up "Struts2 in action" book, which is quite all right but enough when the need comes to quickly solve few isues.. details
      • It works so try again.. details
      • Can anyone please tell me some solution for this CODESNIPPET_JAVA1 .. details
      • Hi Betsey, and welcome to Stack Overflow.. details
      • Not necessary, If you are using Struts 2 why not to use URL_http://code.google.com/p/struts2-jquery/ [struts2-jquery-plugin] and make grids more easier like described URL_http://code.google.com/p/struts2-jquery/wiki/GridTag [here] .. details
      • And then changing the JSP line with specifying data: to be like: CODESNIPPET_JAVA7 .. details
      • Hey it works.. details
      • When _def_ is empty or not defined my program stops working on the line CODETERM1 and noticed that it doesn't continue the execution?!. details
      • I've seen a lot of ways to register the provider with the Wink server, but not the Wink client.. details
    6. json: 12
      • i have tried those parametes, and it seems that my JSON still trying to read the properties that missing !!. details
      • Declare the field you'd like to return as JSON string like the field of your action, provide the getter and setter.. details
      • i have a form (displayed on the client) with several fields , and some fields are filled with JSON (like country List).. details
      • so i'm looking for a way to make my JSON class to ignore those properties, whose has to be treated on another Action CLASS!!!. details
      • I believe that if I can get a Java String that contains the correct representation, that Mezzie's solution, below, will allow me to create the string with the correct encoding to put back into the JSON to serve back.. details
      • So to clarify, if the JSON contains the string "Juan Guzmn", the Java String contains something like Juan Guzm?_An (I don't have the exact one in front of me).. details
      • in order to get this JSON object defined in the element _def_ This only works if _def_ isn't empty like in this example: CODESNIPPET_JAVA4 .. details
      • If your response is JSON I would recommend using the struts2-json plugin URL_http://struts.apache.org/2.1.8/docs/json-plugin.html [ URL_http://struts.apache.org/2.1.8/docs/json-plugin.html ] and setting the enableGZIP param to true.. details
      • To be complete honest, I don't find the Spring integration all that compelling, which isn't really a big deal.Much like Spring MVC versus Struts, I'm not really expecting a lot of change with the Spring Rest JSON functionality, I'm just trying to figure out if it actually exists so I can try it out.. details
      • It works fine without compression but if I compress JSON responses, I can not see my JSON objects anymore.. details
      • For me, it looks like JQuery does not recognize the response as JSON because I am adding the Gzip compression.. details
      • Yes, everything works involving JSON works fine without the compression.. details
    7. class: 1
      • And the user class has properties like CODETERM2 etc.. details
  • Onlysentiment: 1
    1. general: 1
      • EDIT : I'm sorry if I wasn't clear enough.. details
  • Documentation: 1
    1. general: 1
      • I would at this time remove the setters (I don't know if you have any spring magic that could cause weirdness), move the User creation into a prepare method and verify that the users are not null (see URL_http://struts.apache.org/2.0.14/docs/prepare-interceptor.html ) and this is just personal preference but @JSON(name="user") when applied to getUser is redundant so I would get rid of the @JSON annotations on the getters.. details
  • Features: 22
    1. jquery: 1
      • I want to do an jQuery ajax submit with the data generated that will be converted to the Java List by Struts 2.. details
    2. jsonexception: 1
      • method, so deeply burried in struts-json-plugin there were JsonException caught, related to InvocationTargetException .. details
    3. jqgrid: 1
    4. ajax: 1
      • The AJAX request being sent to the server follows the following format (GET query string): CODESNIPPET_JAVA1 .. details
    5. general: 7
      • json-default?. details
      • I know that I can exclude properties.. details
      • When I add struts2-json- plugin-2.1.8.1.jar the problems come while deploying.. details
      • I'm having trouble with a conflict when adding that jar.. details
      • Nope the struts property is still null.. details
      • I tried this Resource struts sonar.find(ResourceQuery.createForMetrics("int egrationContinue:integrationContinue", "coverage", "lines", "violations"));Measure s=struts.getMeasure("coverage");System.out.println(s.getData());.. details
      • or (non-escaped): CODESNIPPET_JAVA2 .. details
    6. ignore: 1
      • Struts , JSON, Ignore some properties.. details
    7. json: 4
      • your package, which includes your action should extends json-default, struts2 2.1.6 have not integrated json plugin, you should include it by yourself on the classpath.. details
      • Is it possible to make struts populate the list by passing the appropriate JSON string, while submitting a jQuery ajax request pointed at that action.. details
      • While running it on my server (struts & commons chains) it gives me back the following json response (after removing static) CODESNIPPET_JAVA3 .. details
      • Struts 2: how to send JSON to action.. details
    8. action: 1
      • I have a struts action receiving following JSON: CODESNIPPET_JAVA1 .. details
    9. serialization: 2
      • How can I exclude a Base class from serialization process of struts json.. details
      • URL_http://stackoverflow.com/questions/4648288/problem-with-json-plugin-in- struts-2/4650575#4650575 [Problem-with-Json-plugin-in-Struts-2] Edit**:Here is an example of using exclude properties in an annotation which blocks the serialization of a nested member: CODESNIPPET_JAVA1 .. details
    10. configuration: 1
      • I wonder if there's any struts configuration I need to make.... details
    11. class: 2
      • Struts 2 returns a whole action class with even request params!.. details
      • If a struts 2 action class have a property of CODETERM1 .. details
  • Bug: 5
    1. general: 5
      • I also tried to add the JSON interceptor, but I think I misunderstood its deserialization process, as explained in the edit.. details
      • If I put CODETERM2 try / catch block I get _JSONObject["def"] is not a JSONObject _ exception, but execution doesn't continue How does CODETERM3 behave???. details
      • Problem with Json plugin in Struts 2.. details
      • Here's the error I receive when I try to run the Struts action: CODESNIPPET_JAVA2 .. details
      • It seems that it may be caused by the way I am sending JSON responses in my Struts Actions.. details
  • Usability: 32
    1. jqgrid: 1
      • Hi I am using JQgrid in my struts 2 web application ... details
    2. database: 1
      • I am currently creating a web-application where the users can fetch tags from the database as JSON, here is my struts action CODESNIPPET_JAVA1 .. details
    3. jsonobject: 3
      • As a result, since JsonObject extends JsonElement from google library, struts sees the bunch of getter methods which it thinks are to be serialized.All the methods CODESNIPPET_JAVA1 .. details
      • I understand that it could be somehow incorrect, but do not know how.Also, I tried to have a results variable in the action as JsonObject (and changing the way it obtains a value to this) CODESNIPPET_JAVA6 .. details
      • If I put CODETERM2 try / catch block I get _JSONObject["def"] is not a JSONObject _ exception, but execution doesn't continue How does CODETERM3 behave???. details
    4. class: 1
      • But I want to exclude a whole class from serializing.. details
    5. object: 1
      • If you are using external lib to convert an object to JSON, then the plugin would have an addition argument to pass the include and exclude list.. details
    6. controller: 1
      • If you are using some framework like Struts/Springs(**Which you should have mentioned**), check if the control is getting passed to your controller class, if the control is not getting passed.. details
    7. general: 8
      • Oh, jeez sorry I remember solving something similar but didn't check the to see if it was the same OP.. details
      • I chosen Struts for this, because I got exposed to it in my J2EE exposure, but seems like it's hard to find consolidated knowledge available.. details
      • In Struts 2 documentation, it is recommended to use ServletResponseAware .. details
      • Use the Struts URL_http://struts.apache.org/release/2.3.x/docs/json- plugin.html ["JSON-Plugin"] .. details
      • I added a quick method specifically for Struts 2.. details
      • It's a legacy application using Struts 1.3.8.. details
      • For your use case (Struts 2), a simple solution would be to place the CODETERM1 property in your CODETERM2 , then refer to it in the JSP page as follows: CODESNIPPET_JAVA2 .. details
      • You can use a frameworks like struts to offload all of the transfer of values onto the framework.. details
    8. json: 10
      • and yes , i'm using struts json plugin !!!. details
      • You'd need to add a new forward for your action in Struts that directs to a JSP to generate the JSON instead of the standard JSP for your webpage.. details
      • I was struggling with this for quite a while, thinking that the problems I am having is due to not understanding Jquery/gqgird/javascript, etc.While that may still be the case, I solved the issue of displaying the data, simply by not using google gson library, and serializing a custom java bean object that maps to my data.Maybe someone can find this useful, and won't have to spend as much time: The errors I was getting was due to fact that Struts json plugin uses reflection to find properties on an object to be serialized.. details
      • @AndreiBrsan : 1 doubt, using this would convert the json object into string.. details
      • In struts json I can serialize all the properties using CODESNIPPET_JAVA2 .. details
      • I want to create a JSON object in java code and then pass it on to javascript/jquery for parsing(further processing).I am using Struts 2 framework.. details
      • I also tried to add the JSON interceptor, but I think I misunderstood its deserialization process, as explained in the edit.. details
      • I want to submit a AJAX request with JSON data which Struts 2 can use to automatically populate the List in the Action class.. details
      • Struts 2: Send a JSON string with JQuery ajax submit to be mapped into a List of complextypes.. details
      • I was using the next code to send JSON responses in Struts web application.. details
    9. result: 1
      • Basically in your struts xml you extend from json-default instead of struts-default, then you return a result type of json.. details
    10. file: 1
      • There should be some issue with your XML File from where the control passes(**Eg: Struts.xml in case of Struts 2**) to the Action class.. details
    11. spring: 2
      • That approach is used actually by popular Web MVC Frameworks like Struts and Spring MVC.. details
      • I would at this time remove the setters (I don't know if you have any spring magic that could cause weirdness), move the User creation into a prepare method and verify that the users are not null (see URL_http://struts.apache.org/2.0.14/docs/prepare-interceptor.html ) and this is just personal preference but @JSON(name="user") when applied to getUser is redundant so I would get rid of the @JSON annotations on the getters.. details
    12. struts2: 1
      • Hi, you do need include json-default and which verson of struts2 are you using?. details
    13. properties: 1
      • If yes, it has include/exclude properties which can be configured in struts.xml.. details
  • Usability
    1. If I put CODETERM2 try / catch block I get _JSONObject["def"] is not a JSONObject _ exception, but execution doesn't continue How does CODETERM3 behave???
      • I would expect it to return an empty JSONObject and continue the execution... What I want is to check if there is anything defined in _def_ and then in a if, else decide what to do in my program according to the value found there...