Package nl.vpro.web.filter.jsonp
Class JsonpFilter
java.lang.Object
nl.vpro.web.filter.jsonp.JsonpFilter
- All Implemented Interfaces:
javax.servlet.Filter
Wraps a JSON response with padding and sets the response content type to application /javascript. This filter is triggered when a callback parameter is present on the URL containing the name for the callback method to use. If the name for the callback parameter is to obvious, you can supply an alternative value in this filters init config.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
JsonpFilter
public JsonpFilter()
-
-
Method Details
-
init
public void init(javax.servlet.FilterConfig config) - Specified by:
init
in interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException - Specified by:
doFilter
in interfacejavax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroy
in interfacejavax.servlet.Filter
-