|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.oddjob.webapp.servlets.InitParam
public class InitParam
Utility class that allows initialisation parameters to be specified either in the Servlet context (the web.xml) or in the container configuration.
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 Summary | |
---|---|
InitParam(ServletConfig config)
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InitParam(ServletConfig config)
config
- The Servlet container configurationMethod Detail |
---|
public String getInitParam(String parameterName)
parameterName
- The parameter.
public String getInitParam(String parameterName, String theDefault)
parameterName
- The parameter.theDefault
- The default value. May be null.
public String getRequiredInitParam(String parameterName) throws ServletException
parameterName
- The parameter.
ServletException
- If the parameter doesn't exist.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |