javatools.servlet
Class CommonServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--javatools.servlet.CommonServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
CrontabEntryServlet, DbServlet

public class CommonServlet
extends javax.servlet.http.HttpServlet

A servlet with extra features for general use.

See Also:
Serialized Form

Constructor Summary
CommonServlet()
           
 
Method Summary
 void forward(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.String url)
          A convenience method for the internal servlet forward method.
static void forward(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.String url, java.util.Map args)
          This method does a servlet forward by passing redirect HTML to the browser.
 void forwardAll(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.String url)
          Does a HTML forward while passing all the previous parameters onto the new URL.
static java.util.Map getParameters(javax.servlet.http.HttpServletRequest req)
          Get all the parameters of the servlet as a Map.
static java.lang.String getParameterUrl(javax.servlet.http.HttpServletRequest req)
          Get all the parameters in the form of a URL to allow passing onto the next servlet.
static java.lang.String getParameterUrl(javax.servlet.http.HttpServletRequest req, java.lang.String except)
           
static java.lang.String getParameterUrl(java.util.Map args, java.lang.String except)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonServlet

public CommonServlet()
Method Detail

forward

public void forward(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res,
                    java.lang.String url)
             throws java.io.IOException,
                    javax.servlet.ServletException
A convenience method for the internal servlet forward method.

java.io.IOException
javax.servlet.ServletException

forward

public static void forward(javax.servlet.http.HttpServletRequest req,
                           javax.servlet.http.HttpServletResponse res,
                           java.lang.String url,
                           java.util.Map args)
                    throws java.io.IOException
This method does a servlet forward by passing redirect HTML to the browser. This is useful because the internal servlet forward method doesn't allow passing parameters.

java.io.IOException

forwardAll

public void forwardAll(javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse res,
                       java.lang.String url)
                throws java.io.IOException
Does a HTML forward while passing all the previous parameters onto the new URL.

java.io.IOException

getParameters

public static java.util.Map getParameters(javax.servlet.http.HttpServletRequest req)
                                   throws java.io.IOException
Get all the parameters of the servlet as a Map.

java.io.IOException

getParameterUrl

public static java.lang.String getParameterUrl(javax.servlet.http.HttpServletRequest req)
                                        throws java.io.IOException
Get all the parameters in the form of a URL to allow passing onto the next servlet.

java.io.IOException

getParameterUrl

public static java.lang.String getParameterUrl(java.util.Map args,
                                               java.lang.String except)
                                        throws java.io.IOException
java.io.IOException

getParameterUrl

public static java.lang.String getParameterUrl(javax.servlet.http.HttpServletRequest req,
                                               java.lang.String except)
                                        throws java.io.IOException
java.io.IOException