org.objectweb.jonas.webapp.jadmin.servlet
Class InitialServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.apache.velocity.servlet.VelocityServlet
              extended byorg.objectweb.jonas.webapp.jadmin.servlet.JadminServlet
                  extended byorg.objectweb.jonas.webapp.jadmin.servlet.InitialServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class InitialServlet
extends JadminServlet

This is the initial servlet called by the Jadmin application.

Author:
Adriana Danes
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.velocity.servlet.VelocityServlet
CONTENT_TYPE, DEFAULT_CONTENT_TYPE, DEFAULT_OUTPUT_ENCODING, INIT_PROPS_KEY, REQUEST, RESPONSE
 
Constructor Summary
InitialServlet()
           
 
Method Summary
 org.apache.velocity.Template handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.velocity.context.Context context)
           Main routine to handle a request.
protected  java.util.Properties loadConfiguration(javax.servlet.ServletConfig config)
          Load the velocity configuratio.
 
Methods inherited from class org.objectweb.jonas.webapp.jadmin.servlet.JadminServlet
alert, createContext, getDate, init
 
Methods inherited from class org.apache.velocity.servlet.VelocityServlet
doGet, doPost, doRequest, error, getTemplate, getTemplate, handleRequest, mergeTemplate, requestCleanup, setContentType
 
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
 

Constructor Detail

InitialServlet

public InitialServlet()
Method Detail

loadConfiguration

protected java.util.Properties loadConfiguration(javax.servlet.ServletConfig config)
                                          throws java.io.IOException,
                                                 java.io.FileNotFoundException
Load the velocity configuratio. Called by the VelocityServlet init(). We set some properties so that Velocity templates will loaded from a directory called "templates" under the Jadmin web application installation directory (i.e. under ../wabapps/jadmin/templates, where jadmin is name of the war containing the web application).

Parameters:
config - the ServletConfig object passed to the servlet by the servlet container
Returns:
java.util.Properties loaded with the Velocity configuration parameters
Throws:
java.io.IOException - I/O problem accessing the Velocity configuration file
java.io.FileNotFoundException - if the Velocity configuration file not found

handleRequest

public org.apache.velocity.Template handleRequest(javax.servlet.http.HttpServletRequest request,
                                                  javax.servlet.http.HttpServletResponse response,
                                                  org.apache.velocity.context.Context context)

Main routine to handle a request. Called by VelocityServlet, your responsibility as programmer is to simply return a valid Template

Parameters:
request - request treated by the servlet
response - response returned by the servlet
context - a Velocity Context object to be filled with data. Will be used for rendering this template
Returns:
Template to be used for request