HttpRedirectFilter

A servlet which implements javax.servlet.Filter interface
Download

HttpRedirectFilter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Publisher Name:
  • Igor Zlatkovic
  • Operating Systems:
  • Windows All
  • File Size:
  • 14 KB

HttpRedirectFilter Tags


HttpRedirectFilter Description

HttpRedirectFilter was developed to be a servlet which implements javax.servlet.Filter interface. It inspects the URL of a HTTP request and either forwards the request to a different location, or redirects the user agent to a new URL. It can be used as a general redirector on a servlet container such as Apache Tomcat. What do I mean by 'HTTP redirect'? See, every resource on the web has an unique identifier called URL. This identifier represents the location of the resource. When resource is moved to a new location, the URL changes. However, the old URL should remain valid, at least for a time. Other web-sites, search engine databases, even manuals for certain products contain the old URL. We want a smooth change, so we continue to serve the resource through the old URL, along with the new, in order to prevent all the links from breaking at once. User agents (browsers) are informed about the change in the URL through HTTP status codes. When an user agent requests a resource which has been moved, the server can do one of the following: - Forward: The server reads the resource from the new location and delivers it to the user agent. The user agent will never know this has happened. The change in the URL is internal to the server and the new URL isn't known to the public. - Redirect temporarily: The server returns the 302 status code to the user agent indicating that the resource is temporarily available at a new URL, which is returned in the response header Location. It is up to the user agent to issue a new HTTP request using the new URL and that is what most browsers do. The saved links, such as bookmarks, should however keep pointing to the old URL because the URL change is considered temporary. - Redirect permanently: The server returns a 301 status code to the user agent indicating that the resource has permanently moved to a new URL, which is returned in the response header Location. It is up to the user agent to issue a new HTTP request using the new URL. Most browsers do exactly this. The saved links, such as bookmarks, should be modified to point to the new URL, as the old one is expected to stop working in the future.


HttpRedirectFilter Related Software