edu.uiuc.ncsa.myproxy.oa4mp.client.servlet
Class MyTomcatFilter

java.lang.Object
  extended by edu.uiuc.ncsa.myproxy.oa4mp.client.servlet.MyTomcatFilter
All Implemented Interfaces:
javax.servlet.Filter

public class MyTomcatFilter
extends Object
implements javax.servlet.Filter

A really basic filter. Any path that starts with a "/pages" or a "/static" is intercepted and passed to the default java servlet that Tomcat runs. Your static content goes into the directory named static and your other content is served from the directory called pages. This fixes a feature of Tomcat 6 that allowed the default servlet to serve up static content from the top-level directory including possibly sensitive information. Tomcat 7 prohibits this, so we have to route static requests ourselves.

Note that this (or some other similar filter) must be specified in your deployment descriptor (web.xml file) in order to serve up static pages.

Created by Jeff Gaynor
on 3/27/12 at 11:11 AM


Constructor Summary
MyTomcatFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
           
 void init(javax.servlet.FilterConfig filterConfig)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyTomcatFilter

public MyTomcatFilter()
Method Detail

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

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 interface javax.servlet.Filter
Throws:
IOException
javax.servlet.ServletException


Copyright © 2013. All Rights Reserved.