com.thetransactioncompany.util
Class PropertyConverter

java.lang.Object
  extended by com.thetransactioncompany.util.PropertyConverter

public class PropertyConverter
extends Object

Static utility methods for converting servlet and context initialisation parameters to Java properties.

Author:
Vladimir Dzhuvinov

Constructor Summary
PropertyConverter()
           
 
Method Summary
static Properties getServletCtxInitParameters(javax.servlet.ServletContext ctx)
          Converts the servlet context initialisation parameters (typically specified in the web.xml file) to a Java properties hashtable.
static Properties getServletInitParameters(javax.servlet.ServletConfig config)
          Converts the servlet initialisation parameters (typically specified in the web.xml file) to a Java properties hashtable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyConverter

public PropertyConverter()
Method Detail

getServletInitParameters

public static Properties getServletInitParameters(javax.servlet.ServletConfig config)
Converts the servlet initialisation parameters (typically specified in the web.xml file) to a Java properties hashtable. The parameter names become property keys.

Note regarding web.xml markup: The servlet initialisation parameters have an XML tag <init-param> and are defined within the <servlet> element.

Parameters:
config - The servlet configuration.
Returns:
The servlet initialisation parameters as Java properties.

getServletCtxInitParameters

public static Properties getServletCtxInitParameters(javax.servlet.ServletContext ctx)
Converts the servlet context initialisation parameters (typically specified in the web.xml file) to a Java properties hashtable. The parameter names become property keys.

Note regarding web.xml markup: The context parameters have an XML tag <context-param> and are defined within the <web-app> element.

Parameters:
ctx - The servlet context.
Returns:
The servlet context parameters as Java properties.


Copyright © 2013 The Transaction Company. All Rights Reserved.