toolbox.web
Class ViewServlet

Package class diagram package ViewServlet
java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by toolbox.web.ViewServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ViewServlet
extends javax.servlet.http.HttpServlet

Servlet to process view request using the FreeMarker Template Engine for rendering.

View requests channelled via this servlet using the following url: http://server/your_app/viewservice?template=<template name>

See Also:
Serialized Form

Constructor Summary
ViewServlet()
          Default constructor
 
Method Summary
 void destroy()
          Destroy this servlet by nulling the member template configuration.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles all GET requests.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles all POST requests.
 void init(javax.servlet.ServletConfig config)
          Initialise the template engine configuration and shared template resources.
 
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, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewServlet

public ViewServlet()
Default constructor

Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initialise the template engine configuration and shared template resources.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - Servlet configuration parameters.
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
Handles all GET requests.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - HTTP request.
response - HTTP 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
Handles all POST requests.

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

destroy

public void destroy()
Destroy this servlet by nulling the member template configuration.

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet