public class InitParam extends Object
The advantage of specifying parameters in the Servlet context is they can be specified on a machine by machine bases and be independent of the deployed web application archive.
This utility will first look for a container parameter before looking for a web.xml version.
Constructor and Description |
---|
InitParam(ServletConfig config)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getInitParam(String parameterName)
Get the initialisation parameter, or null if it's not specified.
|
String |
getInitParam(String parameterName,
String theDefault)
Get the initialisation parameter with a default if it's not specified.
|
String |
getRequiredInitParam(String parameterName)
Get a parameter that must be specified.
|
public InitParam(ServletConfig config)
config
- The Servlet container configurationpublic String getInitParam(String parameterName)
parameterName
- The parameter.public String getInitParam(String parameterName, String theDefault)
parameterName
- The parameter.theDefault
- The default value. May be null.