Class ScreenshotServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class ScreenshotServlet
    extends javax.servlet.http.HttpServlet
    Implementation of a servlet which generates images suitable for use in publications. These are aimed at being an improvement over simply taking a screenshot of a WMS client. The parameters this request accepts are (optional unless specified): image: true/false. Whether to generate an image or just an HTML page containing the image. This is generally not included. baseUrl: The WMS URL of the background map baseLayers: The layers to display from the background map bbox: The bounding box defining the viewport (mandatory) crs: The co-ordinate reference system code (mandatory) mapHeight: The desired height of the map mapWidth: The desired width of the map layerTitle: A comma-separated list of strings which make up the title. Each line represents the child of the NEXT one and is rendered as such. For example "TMP,FOAM one degree" will be similarly to: FOAM one degree > TMP elevation: A string representing the elevation time: A string representing the time server: The URL of the WMS server layer: The WMS layer name of the layer on the above server style: The base name of the style palette: The name of the palette to use scaleRange: Comma-separated colour scale range numColorBands: The number of colour bands to use targetElevation: The target elevation (for in-situ data) targetTime: The target time (for in-situ data) opacity: The overall opacity of the plotted layer TODO Error handling is not implemented very well
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doGet​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Handles a GET request.
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
    • Constructor Detail

      • ScreenshotServlet

        public ScreenshotServlet()
    • Method Detail

      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws javax.servlet.ServletException,
                             IOException
        Handles a GET request. This will generate a screenshot and write it to the output stream, assuming This should be mapped to the correct URL in the web.xml
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
        See Also:
        HttpServlet.doGet(HttpServletRequest request, HttpServletResponse response)