Hi all,

I'm using struts2-core 2.3.16.3 along with struts2-json-plugin and I have the following problem:

I have an entity bean, say Event which has the following 3 properties:
id, dateCreated and data

data is already a json string saved in the database.
e.g.:
Event data: {"id":1003,"username":"admin3","email":"t...@example.com","lastname":"Lastname","f_user_type":1,"firstname":"Firstname","password":"fdhfdfh"}

Now in my struts2 action I have a List<Event> gridModel which I feed to a jquery grid.

My problem is that the data property string is being escaped, e.g:

{"JSON":"success","actionErrors":[],"actionMessages":[],"someId":"3","destination":null,"errorMessages":[],"errors":{},"fieldErrors":{},"gridModel":[{"data":"{\"id\":1,\"username\":\"admin\",\"email\":\"ad...@example.com\",\"lastname\":\"Lastname\",\"f_user_type\":1,\"firstname\":\"Firstname\",\"password\":\"***\"}","dateCreated":"2014-05-30T18:15:10","id":46009},{"data":"{\"id\":1002,\"username\":\"admin2\",\"email\":\"t...@example.com\",\"lastname\":\"Lastname\",\"f_user_type\":1,\"firstname\":\"Firstname\",\"password\":\"****\"}","dateCreated":"2014-05-30T18:15:10","id":46010},{"data":"{\"id\":1004,\"username\":\"admin4\",\"email\":\"t...@example.com\",\"lastname\":\"Lastname\",\"f_user_type\":1,\"....


Is there any way to avoid this escaping? What alternatives do I have?
One idea is to just return a tiles plugin and create the json string by hand in a jsp.

From what I've seen @JSON annotation does not have the option to skip escaping. This might be nice.

Regards
Dimitris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to