public class RedirectToDocsFilter extends Object implements javax.servlet.Filter
Specifically, if the request is to "/" but the Accept header is anything other than "application/json" (eg is set to "text/html" and suggesting that the user is using a browser to access the webapp) then the filter redirects to /index.html (the documentation pages).
Only if the Accept header is set to application/json is the request allowed to continue through.
| Constructor and Description |
|---|
RedirectToDocsFilter() |
public RedirectToDocsFilter()
public void init(javax.servlet.FilterConfig cfg) throws javax.servlet.ServletException
init in interface javax.servlet.Filterjavax.servlet.ServletExceptionpublic void destroy()
destroy in interface javax.servlet.Filterpublic void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter in interface javax.servlet.FilterIOExceptionjavax.servlet.ServletExceptionCopyright © 2010–2014 The Apache Software Foundation. All rights reserved.