@WebFilter(value="/rest/*")
public class JSONPRequestFilter
extends java.lang.Object
implements javax.servlet.Filter
This filter wraps qualified requests for JSON content with that standard JSONP padding. This makes these calls accessible cross-domain using standard JSONP approaches.
To qualify for wrapping the request must be made to the /rest/* path, and contain a query parameter call jsoncallback> that defines the JSONP callback method to use with the response.
Constructor and Description |
---|
JSONPRequestFilter() |
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
java.io.IOException
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Filter