Hi
On 06/05/13 19:46, trimble wrote:
I have a JAX-RS service return a simple java object that contains "/" in the
String value and that will be escaped into "\/". How can I stop this
behavior?

        @GET    
        @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
        @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
        @Path("{id}")
        public Vehicle getVehicle(@PathParam("id") String id) {
             // cook a Vehicle instance that has one of the field: String
urlStr = "http://test.com/test/";;
             return veh;
         }

the result I got for that field will be: "http:\/\/test.com\/test\/".

I'm looking at some of StackOverflow posts like
http://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped

apparently it is a default in some cases but proper JSON libraries should allow for configuring it. I'll deal with it in the next Jettison release, I'll keep you up-to-date.

Please check if Jackson can do it in meantime

Sergey



--
View this message in context: 
http://cxf.547215.n5.nabble.com/forwardslash-being-escaped-from-json-response-tp5727304.html
Sent from the cxf-user mailing list archive at Nabble.com.


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to