Re: How do i prevent Struts 2 json plugin from escaping already formated json?

2015-02-18 Thread Dave Newton
Don't use the JSON plugin? The point of it is to create JSON, but you already have JSON. On Feb 18, 2015 7:18 AM, "bavon mike" wrote: > I already have a json string like: > > {"name": "Simple name", "description": "simple descriptio

How do i prevent Struts 2 json plugin from escaping already formated json?

2015-02-18 Thread bavon mike
I already have a json string like: {"name": "Simple name", "description": "simple description"} When using Struts 2 json plugin, it returns escaped string like: {\"name\": \"Simple name\", \"description\": \"simpl

Re: Struts 2 JSON plugin change in finding the target action instance problem Pavel Ilyushko Original Poster Greenhorn Joined: Nov 05, 2014 Posts: 1

2014-11-05 Thread Lukasz Lenart
2014-11-05 13:41 GMT+01:00 Pavel Ilyushko : > Hi there! > > Thanks for a swift reply. > > Actually, re-defining the root is what I applied as a work-around. > > So in my struts.xml I have this (to fix setting the parameters on the > action): > > > action >

Re: Struts 2 JSON plugin change in finding the target action instance problem Pavel Ilyushko Original Poster Greenhorn Joined: Nov 05, 2014 Posts: 1

2014-11-05 Thread Pavel Ilyushko
Hi there! Thanks for a swift reply. Actually, re-defining the root is what I applied as a work-around. So in my struts.xml I have this (to fix setting the parameters on the action): action and also for each json action type I have this (to

Re: Struts 2 JSON plugin change in finding the target action instance problem Pavel Ilyushko Original Poster Greenhorn Joined: Nov 05, 2014 Posts: 1

2014-11-05 Thread Łukasz Lenart
You can redefine root http://struts.apache.org/release/2.3.x/docs/json-plugin.html#JSONPlugin-RootObject 2014-11-05 12:13 GMT+01:00 Pavel Ilyushko : > Hello there! > > Recently I've upgraded our struts2 framework and its related plugins (eg: > json plugin) from version 2.1.8 to version 2.3.16.3.

Re: Struts 2 JSON plugin change in finding the target action instance problem Pavel Ilyushko Original Poster Greenhorn Joined: Nov 05, 2014 Posts: 1

2014-11-05 Thread Lukasz Lenart
You can re-define root http://struts.apache.org/release/2.3.x/docs/json-plugin.html#JSONPlugin-RootObject 2014-11-05 12:13 GMT+01:00 Pavel Ilyushko : > Hello there! > > Recently I've upgraded our struts2 framework and its related plugins (eg: > json plugin) from version 2.1.8 to version 2.3.16.3.

Struts 2 JSON plugin change in finding the target action instance problem Pavel Ilyushko Original Poster Greenhorn Joined: Nov 05, 2014 Posts: 1

2014-11-05 Thread Pavel Ilyushko
Hello there! Recently I've upgraded our struts2 framework and its related plugins (eg: json plugin) from version 2.1.8 to version 2.3.16.3. Now I'm having problems in using the json plugin while making json requests and returning the json responses. The problem is that the parameter values passe

Struts 2 JSON plugin

2010-01-18 Thread Artashes Hovasapyan
Hi, I've just started using JSON plugin and noticed strange behaviour. It looks like JSON annotation fields are completely ignored by the plugin. My action looks like this: public class TestAction extends ActionSupport { private Date date; @JSON(format = "-MM-dd HH:mm:ss Z") publ

Re: Struts 2/JSON/Hibernate/c3p0/Oracle issue

2009-12-14 Thread Timothy Orme
So changing this around seems to correct it. I'm not sure why though, to my knowledge it shouldn't have been using a proxy. public class ChangeProcessAction { private StatusService statusService; private OrderService orderService; private Status status; private Integer orderId;

Re: Struts 2/JSON/Hibernate/c3p0/Oracle issue

2009-12-14 Thread Timothy Orme
Ill give this a whirl, and you're probably right, but this used to work while using DBCP. Any idea as to why this would be broken in c3p0? I tried to do some digging under the hood but couldn't find sources the classes that were breaking. Thanks, -Tim Greg Lindholm wrote: Wild guess you

Re: Struts 2/JSON/Hibernate/c3p0/Oracle issue

2009-12-14 Thread Greg Lindholm
Wild guess you are trying to serialize (with JSON plugin) a Hibernate proxy object. Maybe your object has a reference to another lazy loaded object or collection. Using reflection on a proxy object is usually a bad idea. You may need to clone the object (to get a real one) first before serial

Struts 2/JSON/Hibernate/c3p0/Oracle issue

2009-12-14 Thread Timothy Orme
Hello, I just recently switched to c3p0 and it fixed some other issues I was having with dbcp, but another has arisen. It seems to be a combination of using the c3p0 data source along with the JSON plugin. Here's my (slightly shortened) stacktrace: Caused by: org.apache.struts2.json.JSO

Re: Problem with Struts 2 JSON RPC using simple HTTP Post (not using DOJO)

2009-12-03 Thread Musachy Barroso
the call reaches the server and returns me an >>> exception : >>> :35,013 ERROR [RPCError] java.util.HashMap cannot be cast to java.util.List >>> java.lang.ClassCastException: java.util.HashMap cannot be cast to >>> java.util.List >>>

Re: Problem with Struts 2 JSON RPC using simple HTTP Post (not using DOJO)

2009-12-03 Thread Musachy Barroso
g.apache.struts2.json.JSONInterceptor.invoke(JSONInterceptor.java:204) >>        at >> org.apache.struts2.json.JSONInterceptor.intercept(JSONInterceptor.java:131) >>        at >> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237

Re: Problem with Struts 2 JSON RPC using simple HTTP Post (not using DOJO)

2009-12-03 Thread Musachy Barroso
oke(DefaultActionInvocation.java:237) >        at > org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) >        at > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) >        at > org.apache.struts2.dispatcher.FilterDispatcher.d

Problem with Struts 2 JSON RPC using simple HTTP Post (not using DOJO)

2009-12-03 Thread Jeet08
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) I am also using Spring 2.5 and H

Re: Struts 2 & JSON

2007-02-07 Thread Musachy Barroso
Just as a follow up to anyone interested, I added the interceptor to the JSON plugin. Dates in RFC 3339 format are also supported. Serialization and deserialization can be customized using annotations. For more details: http://cwiki.apache.org/S2PLUGINS/json-plugin.html musachy Musachy Barros

Re: Struts 2 & JSON

2007-01-12 Thread Musachy Barroso
Added. musachy Frank W. Zammetti wrote: I'm in the last month or so of work on my next book, so chances are you'll finish it all off long before I have a chance to jump in, but just in case, my username is fzammetti (I'm not terribly original!) In the mean time, feel perfectly free to ping me

Re: Struts 2 & JSON

2007-01-12 Thread Musachy Barroso
Well my intention was to have it in S2, given some people need it and it is a simple thing. The autocompleter tag also needs it, but that one will fly to a plugin soon after 2.0.3. As a side not, for those interested on ajax stuff, check the GWT S2 plugin also, free membership available for you

Re: Struts 2 & JSON

2007-01-12 Thread Ian Roughley
Actually, I was going to commit it as a plug-in to the s2 code base in the next few weeks. But since Musachy started a separate project, it seems logical to have it all together - also means I have less to do ;-) /Ian Ted Husted wrote: :) I think this is the part where Musachy gives Ian ac

Re: Struts 2 & JSON

2007-01-12 Thread Frank W. Zammetti
I'm in the last month or so of work on my next book, so chances are you'll finish it all off long before I have a chance to jump in, but just in case, my username is fzammetti (I'm not terribly original!) In the mean time, feel perfectly free to ping me if you have any questions about the code (I

Re: Struts 2 & JSON

2007-01-12 Thread Musachy Barroso
This whole thing started with Frank's code, and I'm indeed going to reuse it. As for access to the google project, I just need the gmail user name. Frank if you are interested jump in and send me your gmail user name. regards musachy Ted Husted wrote: :) I think this is the part where Musach

Re: Struts 2 & JSON

2007-01-12 Thread Ted Husted
:) I think this is the part where Musachy gives Ian access to the Google Code project :) On 1/12/07, Ian Roughley <[EMAIL PROTECTED]> wrote: I think Frank already has the code in the defect, adding it would be very simple. /Ian -

Re: Struts 2 & JSON

2007-01-12 Thread Ian Roughley
I think Frank already has the code in the defect, adding it would be very simple. /Ian Musachy Barroso wrote: That will be coming up next, I need the JSON result of other things and didn't have time to do the whole result/interceptor thing, so this is just the first part :) thanks musachy

Re: Struts 2 & JSON

2007-01-11 Thread Frank W. Zammetti
It does indeed... populates from JSON -or- XML, and provides output in both formats. Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of "Practical Ajax Projects With Java Technology"

Re: Struts 2 & JSON

2007-01-11 Thread Musachy Barroso
That will be coming up next, I need the JSON result of other things and didn't have time to do the whole result/interceptor thing, so this is just the first part :) thanks musachy Ian Roughley wrote: Have you looked at http://issues.apache.org/struts/browse/WW-1330? It might be a great compa

Re: Struts 2 & JSON

2007-01-11 Thread Ian Roughley
Have you looked at http://issues.apache.org/struts/browse/WW-1330? It might be a great companion for your result type. I believe it allows an action to be populated from a JSON request. /Ian Musachy Barroso wrote: The JSON plugin has been added to the registry. Hosted here: http://code.go

Re: Struts 2 & JSON

2007-01-11 Thread Musachy Barroso
The JSON plugin has been added to the registry. Hosted here: http://code.google.com/p/jsonplugin/ regards musachy Ted Husted wrote: On 1/8/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Soon we will have a "json" result type, that will take care of serializing the action to a json string for

Re: Struts 2 & JSON

2007-01-11 Thread Musachy Barroso
That's true, I was thinking about it yesterday, I will roll it into a plugin today. musachy Ted Husted wrote: On 1/8/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Soon we will have a "json" result type, that will take care of serializing the action to a json string for you. Why wait? Someo

Re: Struts 2 & JSON

2007-01-11 Thread Ted Husted
On 1/8/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Soon we will have a "json" result type, that will take care of serializing the action to a json string for you. Why wait? Someone could convert WW-1604 and WW- 1330 to a plugin, post it to the registry, and people could start using it today.

Re: Struts 2 & JSON

2007-01-08 Thread Musachy Barroso
The autocmpleter needs to get the data in some format, that format is JSON, the response needs to be something like: [ ["Text1", "Key1"], ["Text2", "Key2"], ] Remember that what you return from "execute" is not the response, it is the result, like "success" or "input", so you can't return

Re: Struts 2 & JSON

2007-01-08 Thread Ted Husted
See also * https://issues.apache.org/struts/browse/WW-1604 On 1/8/07, Dariusz Wojtas <[EMAIL PROTECTED]> wrote: http://json.org/ Something of form: [["name", "id"], ["name", "id"]] or [["name", "id"], ["name", "id"],] Remember to escape special characters. Dariusz Wojtas On 1/8/07, André

Re: Struts 2 & JSON

2007-01-08 Thread Dariusz Wojtas
http://json.org/ Something of form: [["name", "id"], ["name", "id"]] or [["name", "id"], ["name", "id"],] Remember to escape special characters. Dariusz Wojtas On 1/8/07, André Faria <[EMAIL PROTECTED]> wrote: What is necessary to write a JSON response in struts to use with a Autocomplete

Struts 2 & JSON

2007-01-08 Thread André Faria
What is necessary to write a JSON response in struts to use with a Autocomplete tag? example: public class JSONListAction { public String execute { return JSON object! } } Thank's André Faria --