com.ashridgetech.gen2j.web
Class LogonServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--com.ashridgetech.gen2j.web.LogonServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class LogonServlet
extends javax.servlet.http.HttpServlet

The entry point to a Gen2J application for all of the Actors. It creates the appropriate session UCM (a subclass of SessionUCM) if it does not exist already. It then forwards the request to the view JSP for that UCM.

LogonServlet is configured with a mapping of path info to SessionUCM class. One of the mappings may be to a default class from null path info. The path info obtained with HttpServletRequest.getPathInfo(), with leading or trailing '/' stripped, is used to decide which type of session UCM object to create.

The configuration is read from a Properties file at the location in the web application /WEB-INF/logon.properties. The properties in this file are in the form:

     "pathInfo".class = "session UCM class name"
 

For example, to specify that the path info /supervisor should cause a session UCM of the class com.ashridgetech.SupervisorSessionUCM to be created, use the property:

     supervisor.class = com.ashridgetech.SupervisorSessionUCM
 

The default session class is configured with the property name default.class.

Version:
1.0
Author:
Paul Boocock
See Also:
Serialized Form

Field Summary
protected  String configPath
          The context-relative path to the configuration properties file.
static String DEFAULT_SESSION_TYPE_KEY
           
static String KEY_SUFFIX
           
protected  HashMap sessionClasses
          The mapping of path info strings to session UCM types.
protected  Map sessionClassMap
           
 
Constructor Summary
LogonServlet()
           
 
Method Summary
 void destroy()
          Gracefully shut down this controller servlet, releasing any resources that were allocated at initialization.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process an HTTP "GET" request.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process an HTTP "POST" request.
protected  void doRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void init()
          Initialize this servlet.
protected  void initConfig()
           
protected  SessionUCM makeSessionUCM(javax.servlet.http.HttpServletRequest request)
           
 
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
 

Field Detail

KEY_SUFFIX

public static final String KEY_SUFFIX

DEFAULT_SESSION_TYPE_KEY

public static final String DEFAULT_SESSION_TYPE_KEY

sessionClassMap

protected Map sessionClassMap

sessionClasses

protected HashMap sessionClasses
The mapping of path info strings to session UCM types.

configPath

protected String configPath
The context-relative path to the configuration properties file.
Constructor Detail

LogonServlet

public LogonServlet()
Method Detail

destroy

public void destroy()
Gracefully shut down this controller servlet, releasing any resources that were allocated at initialization.
Overrides:
destroy in class javax.servlet.GenericServlet

init

public void init()
          throws javax.servlet.ServletException
Initialize this servlet.
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException - if we cannot configure ourselves correctly

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws IOException,
                  javax.servlet.ServletException
Process an HTTP "GET" request.
Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws IOException,
                   javax.servlet.ServletException
Process an HTTP "POST" request.
Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

doRequest

protected void doRequest(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws IOException,
                         javax.servlet.ServletException

makeSessionUCM

protected SessionUCM makeSessionUCM(javax.servlet.http.HttpServletRequest request)
                             throws javax.servlet.ServletException

initConfig

protected void initConfig()
                   throws javax.servlet.ServletException


Copyright © 2002 Ashridge Technologies Ltd. All Rights Reserved.