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.