info.aduna.webapp.filters
Class ResourceRedirectFilter

java.lang.Object
  extended by info.aduna.webapp.filters.ResourceRedirectFilter
All Implemented Interfaces:
javax.servlet.Filter
Direct Known Subclasses:
AliasRedirectFilter, WelcomeRedirectFilter

public abstract class ResourceRedirectFilter
extends Object
implements javax.servlet.Filter

Abstract Filter that redirects requests for one resource to another based on some heuristic to be implemented in subclasses.

Author:
Herko ter Horst

Constructor Summary
ResourceRedirectFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain)
           
protected abstract  String getCanonicalPath(String originalPath)
           
protected  javax.servlet.FilterConfig getFilterConfig()
           
 void init(javax.servlet.FilterConfig config)
           
protected abstract  void initialize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceRedirectFilter

public ResourceRedirectFilter()
Method Detail

getFilterConfig

protected javax.servlet.FilterConfig getFilterConfig()

initialize

protected abstract void initialize()
                            throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

getCanonicalPath

protected abstract String getCanonicalPath(String originalPath)
Parameters:
originalPath -
Returns:
the canonical path for the specified original path, or null if the original path should be handled as-is according to this filter

init

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

doFilter

public void doFilter(javax.servlet.ServletRequest req,
                     javax.servlet.ServletResponse res,
                     javax.servlet.FilterChain chain)
              throws IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
IOException
javax.servlet.ServletException

destroy

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


Copyright © 1997-2008 Aduna. All Rights Reserved.