ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Two Servlet Filters Every Web Application Should Have
Subject:   ONJava.com: Two Servlet Filters Every Web Application Should Have [Nov. 19, 2003]
Date:   2003-11-21 08:09:20
From:   anonymous2
Response to: ONJava.com: Two Servlet Filters Every Web Application Should Have [Nov. 19, 2003]

There are a few important points I'd like to make and they are listed with the more important points first. The first is you should almost always use some sort of caching and compression. The second point, is that it should be easy. And the third point is that it should be flexible.


About the first point. There are many ways to cache/compress content. Apache can do it, as can most any decent web server. You will certainly benefit no matter what you choose to use.


About the second point. The filters I presented are about as simple as they come, and they are 100% portable on any Java web app -- Apache backend or not. If you are doing Java web app development, you can configure these two filters once and simply reuse it for every other Java web app you ever make. All the deployment issues are transparent. I like this quite a lot because it means there are fewer configuration issues to worry about when setting up a new project, especially if you must use specific J2EE sever X or not-Apache solution Y.


About the final point. If you bundle cache/compression code in with your primary development environment you can do just about whatever you like. Modifying these two filters to do some sort of odd-ball functionality is near trivial for a Java developer, which hopefully you are if you are using them.... However, if I don't want my Apache (or other server) gzip support to compress content on the third day of the month, when requests are coming from my IP, and if I'm logged in to the web app as admin, it is near impossible to do.


So let me rehash. However you do this stuff is great. But, if you are working with Java web apps, something like these two filters is probably the ideal.


Cheers,
Jayson Falkner
jayson@jspinsider.com


1 to 1 of 1
  1. ONJava.com: Two Servlet Filters Every Web Application Should Have [Nov. 19, 2003]
    2003-11-22 21:20:24  anonymous2 [View]

    • ONJava.com: Two Servlet Filters Every Web Application Should Have [Nov. 19, 2003]
      2003-12-01 01:23:51  anonymous2 [View]

    • ONJava.com: Two Servlet Filters Every Web Application Should Have [Nov. 19, 2003]
      2003-11-24 14:52:26  anonymous2 [View]

1 to 1 of 1