velosurf.util
Class NullServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by velosurf.util.NullServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class NullServlet
extends javax.servlet.http.HttpServlet

A null servlet, provided here for convenience, that will redirect the user to the forbidden uri (if provided in the init parameter "forbidden-uri") or respond with the FORBIDDEN error code.

Author:
Claude Brisson
See Also:
Serialized Form

Field Summary
private  java.lang.String forbiddenUri
          page showing the 'forbidden' error message
 
Constructor Summary
NullServlet()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          doGet handler.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          doPost handler.
private  void doRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          doRequest handler.
 void init(javax.servlet.ServletConfig config)
          init.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

forbiddenUri

private java.lang.String forbiddenUri
page showing the 'forbidden' error message

Constructor Detail

NullServlet

public NullServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
init.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - config
Throws:
javax.servlet.ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
doGet handler.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - request
response - response
Throws:
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   java.io.IOException
doPost handler.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - request
response - response
Throws:
javax.servlet.ServletException
java.io.IOException

doRequest

private void doRequest(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       java.io.IOException
doRequest handler.

Parameters:
request - request
response - response
Throws:
javax.servlet.ServletException
java.io.IOException


~ooOoo~