Class ServletWebMap

java.lang.Object
org.bzdev.ejws.WebMap
org.bzdev.ejws.maps.ServletWebMap

public class ServletWebMap extends WebMap
WebMap for servlet compatibility. This web map uses an implementation of the interface ServletAdapter to provide application-specific behavior. To configure this web map, use an instance of the class ServletWebMap.Config.
See Also:
  • Constructor Details

  • Method Details

    • configure

      protected void configure() throws Exception
      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 by EmbeddedWebServer by calling WebMap.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 class WebMap
      Throws:
      Exception - an error occurred
      See Also:
    • 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 class WebMap
      See Also:
    • 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 class WebMap
      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 URL
      fragment - the fragment portion of a URI
      requestInfo - 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