com.acsinet_solutions.cetia4.controller.support
Class ServletConfigurationImpl

java.lang.Object
  extended by com.acsinet_solutions.cetia4.controller.support.ServletConfigurationImpl
All Implemented Interfaces:
Configuration

public class ServletConfigurationImpl
extends java.lang.Object
implements Configuration

A servlet based configuration instance. Loads it's values from ServletContext or an external XML file.

Author:
Santiago Arriaga

Field Summary
 
Fields inherited from interface com.acsinet_solutions.cetia4.controller.Configuration
CONFIGURATION_FILE_PARAM, CONTROLLER_PATH_PARAM, DEFAULT_LOGIN_PARAM, DISPLAY_SYSTEM_EXCEPTIONS_PARAM, ICON_DIR_PARAM, LOGIN_TYPE_PARAM, METHODS_DELETE_PARAM, METHODS_INSERT_FORM_PARAM, METHODS_INSERT_PARAM, METHODS_UPDATE_FORM_PARAM, METHODS_UPDATE_PARAM, PORTAL_PATH_PARAM, PREFIX, SERVICES_FILE_PARAM, VALIDATION_BUNDLE_PARAM, WEB_DEFAULT_EXTENSION_PARAM, WEB_SERVICE_DEFAULT_EXTENSION_PARAM, WEB_SERVICE_VIEWS_PATH_PARAM, WEB_VIEWS_PATH_PARAM
 
Constructor Summary
ServletConfigurationImpl(Configuration parent, javax.servlet.ServletConfig config)
          Create a configuration for a single servlet.
ServletConfigurationImpl(javax.servlet.ServletContext context)
          Main constructor, initializes the map from context values.
 
Method Summary
 java.lang.String get(java.lang.String key)
          Get a parameter by key.
 boolean getBoolean(java.lang.String key)
          Return the given attribute as a boolean value.
 java.lang.String getDefaultDeleteMethod()
          Get the default method that will be called for a DELETE HTTP request.
 java.lang.String getDefaultPostMethod()
          Get the default method that will be called for a POST HTTP request.
 java.lang.String getDefaultPutMethod()
          Get the default method that will be called for a PUT HTTP request.
 java.util.Map<java.lang.String,java.lang.String> getParams()
          Get a read-only view of the parameters of this configuration.
 java.lang.String getWebDefaultExtension()
          Return the default extension for web requests
 java.lang.String getWebServiceDefaultExtension()
          Return the default extension used for web service views.
 java.lang.String getWebServiceViewsPath()
          Get the web service view path used for web service views.
 java.lang.String getWebViewsPath()
          Get the web view path used for traditional web views.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletConfigurationImpl

public ServletConfigurationImpl(javax.servlet.ServletContext context)
Main constructor, initializes the map from context values. All context values - cetia or not - are loaded in this method.


ServletConfigurationImpl

public ServletConfigurationImpl(Configuration parent,
                                javax.servlet.ServletConfig config)
Create a configuration for a single servlet. Additional parameters may be added. The servlet name is needed to locate in the initial configuration parameters for the given servlet.

Method Detail

get

public final java.lang.String get(java.lang.String key)
Description copied from interface: Configuration
Get a parameter by key.

Specified by:
get in interface Configuration
Parameters:
key - A not-null value.
Returns:
The requested parameter, null if it was not set.

getParams

public final java.util.Map<java.lang.String,java.lang.String> getParams()
Description copied from interface: Configuration
Get a read-only view of the parameters of this configuration.

Specified by:
getParams in interface Configuration

getBoolean

public final boolean getBoolean(java.lang.String key)
Description copied from interface: Configuration
Return the given attribute as a boolean value.

Specified by:
getBoolean in interface Configuration

getWebDefaultExtension

public final java.lang.String getWebDefaultExtension()
Description copied from interface: Configuration
Return the default extension for web requests

Specified by:
getWebDefaultExtension in interface Configuration
See Also:
ServletConfigurationImpl#WEB_DEFAULT_EXTENSION

getWebServiceDefaultExtension

public final java.lang.String getWebServiceDefaultExtension()
Description copied from interface: Configuration
Return the default extension used for web service views.

Specified by:
getWebServiceDefaultExtension in interface Configuration
See Also:
ServletConfigurationImpl#WEB_SERVICE_DEFAULT_EXTENSION

getWebViewsPath

public final java.lang.String getWebViewsPath()
Description copied from interface: Configuration
Get the web view path used for traditional web views.

Specified by:
getWebViewsPath in interface Configuration
See Also:
ServletConfigurationImpl#WEB_VIEWS_PATH

getWebServiceViewsPath

public final java.lang.String getWebServiceViewsPath()
Description copied from interface: Configuration
Get the web service view path used for web service views.

Specified by:
getWebServiceViewsPath in interface Configuration
See Also:
ServletConfigurationImpl#WEB_SERVICE_VIEWS_PATH

getDefaultDeleteMethod

public final java.lang.String getDefaultDeleteMethod()
Description copied from interface: Configuration
Get the default method that will be called for a DELETE HTTP request.

Specified by:
getDefaultDeleteMethod in interface Configuration

getDefaultPostMethod

public final java.lang.String getDefaultPostMethod()
Description copied from interface: Configuration
Get the default method that will be called for a POST HTTP request.

Specified by:
getDefaultPostMethod in interface Configuration

getDefaultPutMethod

public final java.lang.String getDefaultPutMethod()
Description copied from interface: Configuration
Get the default method that will be called for a PUT HTTP request.

Specified by:
getDefaultPutMethod in interface Configuration