|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.commons.scaffold.http.ResourceServlet
Base servlet for loading application resources.
| Constructor Summary | |
ResourceServlet()
|
|
| Method Summary | |
void |
destroy()
Gracefully shut down this controller servlet, releasing any resources that were allocated at initialization. |
protected void |
destroyCustom()
Release any custom resources created at initialization |
protected void |
destroyDefault()
Release any default resources created at initialization |
int |
getInitInt(java.lang.String parameter,
int defaultValue)
Check for a parameter and returns a default value if not found, or if the value does not convert to an int. |
java.util.Map |
getInitParameters()
Return a map of this servlet's initialization parameters. |
java.lang.String |
getInitString(java.lang.String parameter,
java.lang.String defaultValue)
Check for a parameter and returns a default value if not found. |
java.util.Properties |
getProperties()
Return the default properties object. |
void |
init()
Initialize this servlet by caling three extension points: initLogging
initDefault
initCustom
The main extension point is initCustom
The default implementation does nothing. |
protected void |
initCustom()
Initialize the custom properties or objects for this application. |
protected void |
initDefault()
Initialize the default properties for this application. |
java.util.Properties |
loadProperties(java.lang.String parameter,
java.lang.String defaultPath,
java.lang.String attribute)
A utility method for loading a Properties file specified by an initialization parameter. |
void |
reload()
Reload the configuration of this controller servlet from our underlying configuration files. |
void |
setProperties(java.util.Properties properties)
Set the default properties object. |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ResourceServlet()
| Method Detail |
public java.lang.String getInitString(java.lang.String parameter,
java.lang.String defaultValue)
parameter - The attribute name to look fordefaultValue - The default to return if the parameter is not found
public int getInitInt(java.lang.String parameter,
int defaultValue)
int.
parameter - The attribute name to look for
public java.util.Map getInitParameters()
public void setProperties(java.util.Properties properties)
public java.util.Properties getProperties()
public java.util.Properties loadProperties(java.lang.String parameter,
java.lang.String defaultPath,
java.lang.String attribute)
throws javax.servlet.ServletException
parameter - The name of the initialization
parameterdefaultPath - The path to use if the
parameter is not foundattribute - If not null, store in
application scope under this attribute name
javax.servlet.ServletException
protected void initDefault()
throws java.io.IOException,
javax.servlet.ServletException
Use the default initialization parameter to specify
another path. Otherwise ["resources/default.properties"] is used.
If the default properties will not be used or specified, override this method with one that does not try to load the default properties.
java.io.IOException - if an input/output error is encountered
javax.servlet.ServletException - if we cannot initialize these resourcesprotected void destroyDefault()
public void init()
throws javax.servlet.ServletException
initLogginginitDefaultinitCustominitCustom
The default implementation does nothing.
The other two methods have reasonable default behaviors that most
subclasses could use as-is.
This may be called again from reload and should be
"re-enterant".
javax.servlet.ServletException - if we cannot configure ourselves
correctlypublic void destroy()
protected void initCustom()
throws java.io.IOException,
javax.servlet.ServletException
java.io.IOException - if an input/output error is encountered
javax.servlet.ServletException - if we cannot initialize these resourcesprotected void destroyCustom()
public void reload()
throws java.io.IOException,
javax.servlet.ServletException
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||