SPT Core API

com.sptci.echo.http
Class Servlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by nextapp.echo.webcontainer.WebContainerServlet
              extended by com.sptci.echo.http.Servlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class Servlet
extends WebContainerServlet

Generic Echo3 Servlet Implementation. The following init-param parameters must be configured for the servlet.

  1. applicationInstance - The fully qualified name of the ApplicationInstance class to initialise in newApplicationInstance().
  2. contentPane - The fully qualified name of the ContentPane class to use in Application.init().
  3. styleSheet - The fully qualified name of the StyleSheet class to use in Application.init().

In addition the followin optional parameters may be configured:

  1. dataDirectory - The name of the system property used to specify the root directory under which the application stores persistent state information.

Copyright 2006 Sans Pareil Technologies, Inc.

Version:
$Id: Servlet.java 4853 2009-08-10 21:10:14Z rakesh $
Author:
Rakesh Vidyadharan 2006-11-23
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class nextapp.echo.webcontainer.WebContainerServlet
WebContainerServlet.MultipartRequestWrapper
 
Field Summary
static String APPLICATION_INSTANCE
          The name of the init-param used to configure the name of the ApplicationInstance that is to be returned by this servlet.
protected  String className
          The fully qualified name of the ApplicationInstance class that will be returned by newApplicationInstance().
static String CONTENT_PANE
          The name of the init-param used to configure the name of the ContentPane that is to be set for Application.window in Application.init().
protected  String contentPane
          The fully qualified name of the ContentPane class that will be used in Application.init().
static String DATA_DIRECTORY
          The name of the init-param used to specify the name of the System Property that must be set for the JVM that indicates the location of the root persistent state directory.
protected  String dataDirectory
          The name of the system property used to specify the root directory to use to store persistent state information.
protected static Logger logger
          The logger used to log errors to.
protected  ThreadLocal<Principal> principal
          A ThreadLocal field used to store the Principal object that represents the name of the current authenticated user.
static String STYLE_SHEET
          The name of the init-param used to configure the name of the StyleSheet that is to be set for Application in Application.init().
protected  MutableStyleSheet styleSheet
          The global instance of the style sheet for the application used in Application.init().
protected  ThreadLocal<User> user
          A ThreadLocal field used to store the User object that represents the currently logged in user.
 
Fields inherited from class nextapp.echo.webcontainer.WebContainerServlet
DEBUG_PRINT_MESSAGES_TO_CONSOLE, DISABLE_CACHING, ENABLE_CLIENT_DEBUG_CONSOLE, SERVICE_ID_BLANK_DOCUMENT, SERVICE_ID_DEFAULT, SERVICE_ID_NEW_INSTANCE, SERVICE_ID_PARAMETER, SERVICE_ID_SESSION_EXPIRED
 
Constructor Summary
Servlet()
          Default constructor.
 
Method Summary
 void init()
          Over-ridden to load the application property file and set the necessary properties.
 ApplicationInstance newApplicationInstance()
          Implementation of mandatory method in WebContainerServlet.
protected  void process(HttpServletRequest request, HttpServletResponse response)
          Over-ridden to handle all uncaught exceptions.
 
Methods inherited from class nextapp.echo.webcontainer.WebContainerServlet
addInitScript, addInitStyleSheet, doGet, doPost, getActiveConnection, getInitScripts, getInitStyleSheets, getMultipartRequestWrapper, getResourceRegistry, getServiceRegistry, setMultipartRequestWrapper
 
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
 

Field Detail

logger

protected static final Logger logger
The logger used to log errors to.


APPLICATION_INSTANCE

public static final String APPLICATION_INSTANCE
The name of the init-param used to configure the name of the ApplicationInstance that is to be returned by this servlet. "applicationInstance"

See Also:
Constant Field Values

CONTENT_PANE

public static final String CONTENT_PANE
The name of the init-param used to configure the name of the ContentPane that is to be set for Application.window in Application.init(). "contentPane"

See Also:
Constant Field Values

STYLE_SHEET

public static final String STYLE_SHEET
The name of the init-param used to configure the name of the StyleSheet that is to be set for Application in Application.init(). "styleSheet"

See Also:
Constant Field Values

DATA_DIRECTORY

public static final String DATA_DIRECTORY
The name of the init-param used to specify the name of the System Property that must be set for the JVM that indicates the location of the root persistent state directory. "dataDirectory"

See Also:
Constant Field Values

className

protected String className
The fully qualified name of the ApplicationInstance class that will be returned by newApplicationInstance().


contentPane

protected String contentPane
The fully qualified name of the ContentPane class that will be used in Application.init().


styleSheet

protected MutableStyleSheet styleSheet
The global instance of the style sheet for the application used in Application.init().


dataDirectory

protected String dataDirectory
The name of the system property used to specify the root directory to use to store persistent state information.


user

protected ThreadLocal<User> user
A ThreadLocal field used to store the User object that represents the currently logged in user. This is populated only for applications that require authentication and/or authorisation.


principal

protected ThreadLocal<Principal> principal
A ThreadLocal field used to store the Principal object that represents the name of the current authenticated user. This applies usually to container managed authentication as opposed to user that applies to application managed authentication.

Constructor Detail

Servlet

public Servlet()
Default constructor. Set the system property for headless operation, in case we need access to the graphics context.

Method Detail

newApplicationInstance

public ApplicationInstance newApplicationInstance()
Implementation of mandatory method in WebContainerServlet.

Specified by:
newApplicationInstance in class WebContainerServlet
Returns:
Returns a new instance of the configured application instance.

init

public void init()
          throws ServletException
Over-ridden to load the application property file and set the necessary properties.

Overrides:
init in class GenericServlet
Throws:
ServletException - If errors are encountered while initialising the styleSheet.

process

protected void process(HttpServletRequest request,
                       HttpServletResponse response)
                throws IOException,
                       ServletException
Over-ridden to handle all uncaught exceptions. The default action is to log the full stack trace for the error condition.

Overrides:
process in class WebContainerServlet
Throws:
IOException
ServletException

SPT Core API