public class WebResourceHandler extends AbstractModulesHandler
TODO: IMPORTANT: Don't use logging anywhere inside this class. When used in a web client, this runs in conjunction with an authentication plugin during session establishment with the P2J server and using logging the application will deadlock.
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
basePath
The parent context path.
|
private java.lang.String |
resPath
The root folder (as is found in the class path jar's) for where to serve the resources.
|
private java.lang.String |
webRoot
The context path for this resource.
|
Constructor and Description |
---|
WebResourceHandler(java.lang.String webRoot,
java.lang.String resPath)
Create a new resource handler with an empty parent context path.
|
WebResourceHandler(java.lang.String basePath,
java.lang.String webRoot,
java.lang.String resPath)
Create a new resource handler with an empty parent context path.
|
Modifier and Type | Method and Description |
---|---|
static org.eclipse.jetty.server.Handler[] |
getWebResourceHandlers(java.lang.String basePath)
Get all the web resource handlers exposed by FWD, via custom paths.
|
boolean |
isModuleRequest(java.lang.String target,
org.eclipse.jetty.server.Request base,
javax.servlet.http.HttpServletRequest request)
Returns true if it is a request for this module, otherwise false.
|
java.lang.String |
mapToResource(java.lang.String target)
Maps the target of the request to its resource name.
|
handle
detectContentType, sendResponse
destroy, doStart, doStop, dumpThis, getServer, setServer
addBean, addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
private final java.lang.String basePath
private final java.lang.String webRoot
private final java.lang.String resPath
public WebResourceHandler(java.lang.String webRoot, java.lang.String resPath)
webRoot
- The context path for this resource.resPath
- The root folder (as is found in the class path jar's) for where to serve the
resources.public WebResourceHandler(java.lang.String basePath, java.lang.String webRoot, java.lang.String resPath)
basePath
- The parent context path.webRoot
- The context path for this resource.resPath
- The root folder (as is found in the class path jar's) for where to serve the
resources.public static org.eclipse.jetty.server.Handler[] getWebResourceHandlers(java.lang.String basePath)
basePath
- The parent context path. May be empty.public boolean isModuleRequest(java.lang.String target, org.eclipse.jetty.server.Request base, javax.servlet.http.HttpServletRequest request)
isModuleRequest
in class AbstractModulesHandler
target
- The target of the request - either a URI or a name.base
- The base request.request
- The object or a wrapper of the request.public java.lang.String mapToResource(java.lang.String target)
mapToResource
in class AbstractModulesHandler
target
- The target of the request - either a URI or a name.