org.dbforms.servlets
Class ConfigServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.dbforms.servlets.ConfigServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class ConfigServlet
extends HttpServlet

This Servlet runs at application startup and reads the XML configuration in dbforms-config.xml, populates a DbFormsConfig - Object and stores it in application context.

Author:
Joe Peer
See Also:
Serialized Form

Constructor Summary
ConfigServlet()
           
 
Method Summary
 void destroy()
          Gracefully shut down this controller servlet, releasing any resources that were allocated at initialization.
 void doGet(HttpServletRequest request, HttpServletResponse response)
          Process an HTTP "GET" request.
 void doPost(HttpServletRequest request, HttpServletResponse response)
          Process an HTTP "POST" request.
 void init()
          Initialize this servlet.
protected  void initApplicationResources()
          Initialize the SubClass information use by the ResourceBundle for this application.
protected  void initLocaleKey()
          Initialize the Locale key for Session scope.
 void initLogging()
          Initialize Logging for this web application a url/path to a log4j properties or xml file should be defined by the servlet init parameter "log4j.configuration"
protected  void initXMLConfig()
          Initialize the mapping information for this application.
protected  void initXMLConfigFile(String config)
          DOCUMENT ME!
protected  void initXMLErrors()
          Initialize the mapping information for this application.
protected  void initXMLValidator()
          Initialize the ValidatorResources information for this application.
protected  void initXMLValidatorRules(ValidatorResources resources, String validator_rules)
          DOCUMENT ME!
protected  void initXMLValidatorValidation(ValidatorResources resources, String validation)
          DOCUMENT ME!
protected  void process(HttpServletRequest request, HttpServletResponse response)
          Process an HTTP 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
 

Constructor Detail

ConfigServlet

public ConfigServlet()
Method Detail

destroy

public void destroy()
Gracefully shut down this controller servlet, releasing any resources that were allocated at initialization.

Specified by:
destroy in interface Servlet
Overrides:
destroy in class GenericServlet

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws IOException,
                  ServletException
Process an HTTP "GET" request.

Overrides:
doGet in class HttpServlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
IOException - if an input/output error occurs
ServletException - if a servlet exception occurs

doPost

public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
            throws IOException,
                   ServletException
Process an HTTP "POST" request.

Overrides:
doPost in class HttpServlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
IOException - if an input/output error occurs
ServletException - if a servlet exception occurs

init

public void init()
          throws ServletException
Initialize this servlet.

Overrides:
init in class GenericServlet
Throws:
ServletException - if we cannot configure ourselves correctly

initLogging

public void initLogging()
Initialize Logging for this web application a url/path to a log4j properties or xml file should be defined by the servlet init parameter "log4j.configuration"


initApplicationResources

protected void initApplicationResources()
Initialize the SubClass information use by the ResourceBundle for this application. ATTENTION: Here the "application" it's use as Class name, not like path/file coordonnates. (see java.util.ResourceBundle)

Throws:
IOException - if an input/output error is encountered
ServletException - if we cannot initialize these resources

initLocaleKey

protected void initLocaleKey()
Initialize the Locale key for Session scope. Usefull for sharing the same Locale across different framework. Ex: By setting "localeKey" to "org.apache.struts.action.LOCALE" you can share the same Locale in the session scope with Struts.


initXMLConfig

protected void initXMLConfig()
                      throws IOException,
                             ServletException
Initialize the mapping information for this application.

Throws:
IOException - if an input/output error is encountered
ServletException - if we cannot initialize these resources

initXMLConfigFile

protected void initXMLConfigFile(String config)
                          throws IOException,
                                 ServletException
DOCUMENT ME!

Parameters:
config - DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!
ServletException - DOCUMENT ME!

initXMLErrors

protected void initXMLErrors()
                      throws IOException,
                             ServletException
Initialize the mapping information for this application.

Throws:
IOException - if an input/output error is encountered
ServletException - if we cannot initialize these resources

initXMLValidator

protected void initXMLValidator()
                         throws ServletException
Initialize the ValidatorResources information for this application.

Throws:
IOException - if an input/output error is encountered
ServletException - if we cannot initialize these resources

initXMLValidatorRules

protected void initXMLValidatorRules(ValidatorResources resources,
                                     String validator_rules)
                              throws ServletException
DOCUMENT ME!

Parameters:
resources - DOCUMENT ME!
validator_rules - DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!
ServletException - DOCUMENT ME!

initXMLValidatorValidation

protected void initXMLValidatorValidation(ValidatorResources resources,
                                          String validation)
                                   throws ServletException
DOCUMENT ME!

Parameters:
resources - DOCUMENT ME!
validation - DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!
ServletException - DOCUMENT ME!

process

protected void process(HttpServletRequest request,
                       HttpServletResponse response)
                throws IOException
Process an HTTP request.

Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
IOException - if an input/output error occurs
ServletException - if a servlet exception occurs


Copyright © 2002-2006 DbForms. All Rights Reserved.