public class WebContextParamsPropertyIO extends AbstractPropertyIO
ServletContext.getInitParameterNames()
into a memory stored Properties instance. <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> ... <context-param> <description>This is a context parameter example</description> <param-name>ContextParam</param-name> <param-value>ContextParam value</param-value> </context-param> ... <web-app>
ServletContext.getInitParameterNames()
,
ServletContext.getInitParameter(String)
,
Properties
,
Serialized FormConstructor and Description |
---|
WebContextParamsPropertyIO(javax.servlet.ServletContext servletContext)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
A short descriptive name of the Property IO.
|
Properties |
getProperties()
Gets all the name,value pair in a Properties class instance.
|
javax.servlet.ServletContext |
getServletContext()
The servlet context which the property IO has beeen initialized.
|
String |
getSource()
Will return the "getServletContext().getContextPath()" if "getServletContext()" is
null than "[NULL]" is returned. |
void |
setValue(String propertyName,
String value)
Sets the name,value as String in the IO.
|
void |
validate()
Validates the PropertyIO.
|
backup, getCacheTime, getLastLoaded, getLastSaved, getLogger, getTypedProperties, getTypedValue, getValue, isCached, isReadonly, logPerformanceGetProperties, logPerformanceSetValue, reload, setCacheTime, storeTypedValue, updateLastLoaded, updateLastSaved, validateWritable
public WebContextParamsPropertyIO(javax.servlet.ServletContext servletContext)
true
, see AbstractPropertyIO.servletContext
- the servlet context from wher the InitParameters are read.AbstractPropertyIO.AbstractPropertyIO(boolean, boolean)
public javax.servlet.ServletContext getServletContext()
public String getName()
PropertyIO
public String getSource()
null
than "[NULL]" is returned.public void setValue(String propertyName, String value) throws PropertyIOException
PropertyIO
propertyName
- the name of the propertyvalue
- the string value of the property.PropertyIOException
- if the IO is readonly or failed to write the value.public void validate() throws PropertyIOException
PropertyIO
PropertyIOException
public Properties getProperties()
PropertyIO
Properties