DJDoc v.1.0.0b-1

Class DjdocFilter

  extended by net.sf.djdoc.servlet.DjdocFilter
All Implemented Interfaces:

public class DjdocFilter
extends java.lang.Object
implements javax.servlet.Filter

This class implements a servlet filter which is invoked before and after the actual servlet class.

Constructor Summary
Method Summary
 void destroy()
          This method does nothing.
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          The "workhorse" method of the filter.
 void init(javax.servlet.FilterConfig config)
          This method does nothing.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public DjdocFilter()
Method Detail


public void init(javax.servlet.FilterConfig config)
This method does nothing.

Specified by:
init in interface javax.servlet.Filter
config - Filter configuration, not needed by this Filter.


public void destroy()
This method does nothing.

Specified by:
destroy in interface javax.servlet.Filter


public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws javax.servlet.ServletException,
The "workhorse" method of the filter. It serves three purposes:
  1. Wrapping the ServletRequest object in a DjdocRequest object. This involves a thorough analysis of the request URI determining the exact type of the request as well as information about the requested API, package, and other fancy stuff.
  2. Authenticating the user. The way this is done depends on the implementation of the UserStrategy.
  3. Processing the result object after the execution of the respective Action. In many cases this just involves a redirection of the response to a JSP, in other cases the content of a static HTML page is copied into the response stream.

Specified by:
doFilter in interface javax.servlet.Filter
request - The current ServletRequest (actually, the HttpServletRequest) of the HTTP conversation
response - The current ServletResponse (in face, a HttpServletResponse) of the HTTP conversation
chain - The nested FilterChain (in our case this consists just of the ActionServlet).

DJDoc v.1.0.0b-1