Hi everyone,

I'd like to announce two new things I've been working on that may
be of general interest to the list.


First, an ISP review system.  In the model of Amazon, you can now tell
the world how you feel about your ISP.  Have they served you?  Or have
they screwed you?  Let people know!  The content is under construction,
but it should be usable.  Email me any feedback.

http://216.127.78.46/isps/servlet/ISPViewAll

Just beware that this is running on a staging machine, not the official
production Servlets.com site, so if there's a problem, email me, but
don't necessarily expect a prompt answer.  :-)  For the record, it's
running Apache 1.3.9 with Tomcat 3.0, and all the pages are built using
WebMacro (www.webmacro.org).


Second, I've made an addition to com.oreilly.servlet.  There's a new
class called CacheHttpServlet.  According to the Javadocs, this is:

               A superclass for HTTP servlets that wish to
               have their output cached and automatically
               resent as appropriate according to the servlet's
               getLastModified() method. To take advantage of
               this class, a servlet must:

                   Extend CacheHttpServlet instead of HttpServlet

                   Implement a getLastModified(HttpServletRequest)
                       method as usual

               This class uses the value returned by
               getLastModified() to manage an internal cache
               of the servlet's output. Before handling a request,
               this class checks the value of getLastModified(),
               and if the output cache is at least as current as
               the servlet's last modified time, the cached
               output is sent without calling the servlet's
               doGet() method.

               In order to be safe, if this class detects that the
               servlet's query string, extra path info, or servlet
               path has changed, the cache is invalidated and
               recreated. However, this class does not
               invalidate the cache based on differing request
               headers or cookies; for servlets that vary their
               output based on these values (i.e. a session
               tracking servlet) this class should probably not
               be used.

               No caching is performed for POST requests.

               CacheHttpServletResponse and
               CacheServletOutputStream are helper classes
               to this class and should not be used directly.

               This class has been built against Servlet API
               2.2. Using it with previous Servlet API versions
               should work; using it with future API versions
               likely won't work.

This class is ideal for servlets that generate dynamic content that
changes rarely (for example, ISPViewAll).  By extending from this
class, you get automatic output caching.  You can use getLastModified()
to control when the cache is invalidated.  With normal use of
getLastModified() there's no server-side caching.

You can get the download the com.oreilly.servlet package at
http://www.servlets.com/resources/com.oreilly.servlet/

Beware, it has not been widely tested yet.  Please if you find anything
not working right, let me know.  It has some debug System.out.println()
calls to let you know what it's doing with the cache.  If you have
problems installing it, you should mail the list since someone there
can probably answer you faster than I will.  I've got more servlets to
write!  :-)

-jh-

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to