next up previous contents
Next: Content Filter Up: Filter API Previous: Reply Filter   Contents

Redirect Filter

The RedirectFilter interface is designed to be used by filters that need to perform an HTTP redirect from one URL to another. Redirects are the mechanism HTTP uses to inform a web browser that a different URL should be used instead of the one requested. This is useful for maintaining old URLs when documents or servers change locations. The RedirectFilter interface provides two methods: needsRedirection() and redirect(). needsRedirection() is used by the filtering system to build a set of filters which are then asked for a redirect location using the redirect() method. The first URL location returned by a filter is used as the redirect location. Figure 4.8 shows the Java code for the RedirectFilter interface.

Figure 4.8: Redirect Filter
\begin{figure}
\begin{center}
\ssp
\begin{verbatim}public interface Redirec...
...tring redirect(Request request);
}\end{verbatim}\dsp
\end{center}\end{figure}



Mark R. Boyns
1999-01-12