ServletAdapter
to provide application-specific
behavior.
To configure this web map, use an instance of the class
ServletWebMap.Config
.- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.bzdev.ejws.WebMap
WebMap.ColorSpec, WebMap.Info, WebMap.RequestInfo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Configure a web map.protected void
Deconfigure a web map.protected WebMap.Info
getInfoFromPath
(String prepath, String epath, String query, String fragment, WebMap.RequestInfo requestInfo) Get an Info object for a resource The prepath argument is typically the path associated with an HTTP Context - the portion of the path that determines which HTTP handler to use.Methods inherited from class org.bzdev.ejws.WebMap
acceptsMethod, addErrorEntry, addGzipSuffix, addMapping, addPageEncoding, addPageEncoding, addWelcome, allowsQuery, asHeaderOps, getContentTypeFromURL, getDisplayDir, getEmap, getEncodingFromURL, getErrorBackgroundColor, getErrorForegroundColor, getErrorInfo, getErrorInfo, getErrorInfo, getFromHeader, getInfo, getInfo, getInfo, getInfo, getInfo, getInfoFromPath, getMimeType, getSuffixToMimeTypeMap, getWebInfHidden, getWebxml, getWelcomeInfo, getWelcomeInfo, getWelcomeList, gzipPaths, newInstance, newInstance, setAllowsQuery, setDisplayDir, setErrorColors, setMethods, setWebInfHidden, stripGZipSuffix, welcomeInfoAvailable
-
Constructor Details
-
ServletWebMap
Constructor.- Parameters:
root
- an instance ofServletWebMap.Config
- Throws:
IllegalArgumentException
-
-
Method Details
-
configure
Configure a web map. Calling this method should initialize or obtain any resources that the web map will use.Subclasses implementing this method must call super.configure() and should do that before performing any subclass-specific actions. If an exception occurs in the
WebMap.configure()
method of a subclass, that exception will be handled byEmbeddedWebServer
by callingWebMap.deconfigure()
. A consequence of this is that the subclass should track what has actually been configured at each step so that the configuration can be undone safely.This method will call the map's servlet adapter's init method. It should be overridden if more initialization is required. The init method's argument is a \texttt{Map} whose keys and values are strings. Such a map can be specified when the constructor is called.
- Overrides:
configure
in classWebMap
- Throws:
Exception
- an error occurred- See Also:
-
WebMap.deconfigure()
WebMap.isConfigured()
-
deconfigure
protected void deconfigure()Deconfigure a web map. Calling this method should release any resources that the web map is using.Subclasses implementing this method must call super.deconfigure() and should do that after performing any subclass-specific actions.
This method will call the map's servlet adapter's destroy method. It should be overridden if more operations are needed to deconfigure this web map.
- Overrides:
deconfigure
in classWebMap
- See Also:
-
WebMap.configure()
WebMap.isConfigured()
-
getInfoFromPath
protected WebMap.Info getInfoFromPath(String prepath, String epath, String query, String fragment, WebMap.RequestInfo requestInfo) throws IOException, EjwsException Description copied from class:WebMap
Get an Info object for a resource The prepath argument is typically the path associated with an HTTP Context - the portion of the path that determines which HTTP handler to use. The remainder is the portion of the path that used as a key to find an actual resource: i.e., the path relative to the root object used to create the web map.Note: This method does not determine compression
- Specified by:
getInfoFromPath
in classWebMap
- Parameters:
prepath
- the initial portion of the request URI (the root URI path - or prefix - for the corresponding file handler)epath
- the remainder of the path portion of a URI (the part that may differ between URL's passed to this object)query
- the query portion of a URLfragment
- the fragment portion of a URIrequestInfo
- an object encapsulating request data (headers, input streams, etc.)- Returns:
- an Info object either describing properties of a resource (e.g., headers, content-length, and a response code) and providing an input stream for that resource or handling a request directly; null if the requested resource could not be found and the caller should handle the error
- Throws:
IOException
- an IO error occurred.EjwsException
- an ejws exception occurred
-