|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectau.com.lastweekend.servlet.ServletContextResource
public class ServletContextResource
Common resource locator for our servlets and filters that may not be rooted at the realPath of the servletContext.
Determine a resourceBase path from a ServletConfig or FilterConfig by trying the following
An empty initParam can be used to override a contextParam setting to return to the container's getRealPath implementation.
| Field Summary | |
|---|---|
static java.lang.String |
CONTEXT_PARAM_RESOURCE_BASE
Common context-param for assigning a resourceBase in the file system to all the servlets/filters that find resources in the web app and need to be aligned. |
static java.lang.String |
INIT_PARAM_RESOURCE_BASE
init param name for filter/servlets to override context-param or container. |
| Constructor Summary | |
|---|---|
ServletContextResource(javax.servlet.FilterConfig config)
|
|
ServletContextResource(javax.servlet.ServletConfig config)
|
|
| Method Summary | |
|---|---|
java.net.URL |
getAbsoluteResource(java.lang.String absolutePath)
Utility to test the existance of a file path. |
java.lang.String |
getRealPath(java.lang.String resourcePath)
|
java.net.URL |
getResource(java.lang.String resourcePath)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String INIT_PARAM_RESOURCE_BASE
Value: "resourceBase"
public static final java.lang.String CONTEXT_PARAM_RESOURCE_BASE
Value: "au.com.lastweekend.servlet.resourceBase"
| Constructor Detail |
|---|
public ServletContextResource(javax.servlet.FilterConfig config)
public ServletContextResource(javax.servlet.ServletConfig config)
| Method Detail |
|---|
public java.net.URL getResource(java.lang.String resourcePath)
public java.lang.String getRealPath(java.lang.String resourcePath)
public java.net.URL getAbsoluteResource(java.lang.String absolutePath)
absolutePath -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||