DJDoc v.1.0.0b-1

net.sf.djdoc.servlet
Class DjdocFilter

java.lang.Object
  extended by net.sf.djdoc.servlet.DjdocFilter
All Implemented Interfaces:
javax.servlet.Filter

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
DjdocFilter()
           
 
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

DjdocFilter

public DjdocFilter()
Method Detail

init

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

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

destroy

public void destroy()
This method does nothing.

Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws javax.servlet.ServletException,
                     java.io.IOException
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
Parameters:
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).
Throws:
javax.servlet.ServletException
java.io.IOException

DJDoc v.1.0.0b-1