Title say about my issue. I need wrap DTO in to a javascript method callback. Currently I return on request JSON. But problem with using this in Ajax because I send GET to o
To follow on from @talawahdotnet, I'm using RestEasy 3.0.9.Final and there is support for JSONP, once enabled, any request with a "callback" query parameter will be wrapped as JSONP. I'm using JBoss so the full docs are here for other containers. Here's the steps I had to do:
In your web.xml add:
resteasy.providers
org.jboss.resteasy.plugins.providers.jackson.JacksonJsonpInterceptor
Make sure you have a WEB-INF/jboss-deployment-structure.xml with:
Make sure you have a resteasy-jackson-provider dependency in your pom.xml, something like:
org.jboss.resteasy
resteasy-jackson-provider
provided