org.apache.tapestry
Class RedirectFilter

java.lang.Object
  extended by org.apache.tapestry.RedirectFilter
All Implemented Interfaces:
Filter

public class RedirectFilter
extends Object
implements Filter

Filter used to redirect a root context URL (i.e., "/context" or "/context/" to the Tapestry application servlet (typically, "/context/app"). This servlet is mapped to "/" and must have a <init-parameter&;gt; redirect-path that is the application servlet's path (i.e., "/app"). If no value is specified, then "/app" is used. The path is always relative to the servlet context, and should always begin with a leading slash.

Filters are only available in Servlet API 2.3 and above.

Servlet API 2.4 is expected to allow a servlets in the welcome list (equivalent to index.html or index.jsp), at which point this filter should no longer be necessary.

Since:
3.0
Version:
$Id: RedirectFilter.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Field Summary
static String REDIRECT_PATH_PARAM
           
 
Constructor Summary
RedirectFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
          This filter intercepts the so-called "default" servlet, whose job is to provide access to standard resources packaged within the web application context.
 void init(FilterConfig config)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REDIRECT_PATH_PARAM

public static final String REDIRECT_PATH_PARAM
See Also:
Constant Field Values
Constructor Detail

RedirectFilter

public RedirectFilter()
Method Detail

init

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

destroy

public void destroy()
Specified by:
destroy in interface Filter

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
This filter intercepts the so-called "default" servlet, whose job is to provide access to standard resources packaged within the web application context. This code is interested in only the very root, redirecting to the appropriate Tapestry application servlet. Other values are passed through unchanged.

Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException