org.talika.tarsis.servlets
Class AbstractServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.talika.tarsis.servlets.AbstractServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
ControllerServlet, ErrorServlet, XmlOutputServlet

public abstract class AbstractServlet
extends javax.servlet.http.HttpServlet

Base implementation of HttpServlet for all web application servlets of Tarsis MV Framework architecture.

Version:
$Revision: 269 $
Author:
Jose M. Palomar
See Also:
Serialized Form

Constructor Summary
AbstractServlet()
           
 
Method Summary
 void destroy()
          Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called by the server to allow a servlet to handle a GET request.
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called by the server to allow a servlet to handle a POST request.
protected  Context getContext()
          Returns the Tarsis context.
protected  Logger getLogger()
          Returns the Tarsis logger.
 java.lang.String getServletInfo()
          Returns a short description of the servlet.
 void init(javax.servlet.ServletConfig config)
          Called by the servlet container to indicate to a servlet that the servlet is being placed into service.
protected abstract  void process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes requests for both HTTP GET and POST methods.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractServlet

public AbstractServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Called by the servlet container to indicate to a servlet that the servlet is being placed into service.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - ServletConfig the ServletConfig object that contains configutation information for this servlet.
Throws:
javax.servlet.ServletException - if an exception occurs that interrupts the servlet's normal operation.
See Also:
Servlet.init(javax.servlet.ServletConfig)

destroy

public void destroy()
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet
See Also:
Servlet.destroy()

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Called by the server to allow a servlet to handle a GET request.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - servlet object that contains the request the client has made of the servlet.
response - servlet object that contains the response the servlet sends to the client.
Throws:
javax.servlet.ServletException - if the request could not be handled.
java.io.IOException - if an input or output error is detected when the servlet handles request.

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Called by the server to allow a servlet to handle a POST request.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - servlet object that contains the request the client has made of the servlet.
response - servlet object that contains the response the servlet sends to the client.
Throws:
javax.servlet.ServletException - if the request could not be handled.
java.io.IOException - if an input or output error is detected when the servlet handles request.

process

protected abstract void process(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Processes requests for both HTTP GET and POST methods.

Parameters:
request - servlet object that contains the request the client has made of the servlet.
response - servlet object that contains the response the servlet sends to the client.
Throws:
javax.servlet.ServletException - if the request could not be handled.
java.io.IOException - if an input or output error is detected when the servlet handles request.

getContext

protected final Context getContext()
Returns the Tarsis context.

Returns:
Context the Tarsis context.

getLogger

protected final Logger getLogger()
Returns the Tarsis logger.

Returns:
Logger the Tarsis logger.

getServletInfo

public final java.lang.String getServletInfo()
Returns a short description of the servlet.

Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet
Returns:
String a short description of the servlet.
See Also:
Servlet.getServletInfo()


Copyright © 2002-2012 Talika Open Source Group. All Rights Reserved.