Class WebAppManifestServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
    Direct Known Subclasses:
    EditorManifestServlet

    public class WebAppManifestServlet
    extends javax.servlet.http.HttpServlet
    Web app manifest servlet.

    This implementation takes the following initialization parameters:

    • name
    • short_name
    • icons and icons.*
    Since:
    1.0
    Author:
    Kaz Nishimura
    See Also:
    Web App Manifest, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String ICONS
      Name of the initialization parameter for the icons of the application.
      static String NAME
      Name of the initialization parameter for the name of the application.
      static String SHORT_NAME
      Name of the initialization parameter for the short name of the application.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static ImageResource[] createIcons​(javax.servlet.ServletConfig config)
      Creates a new array of icons from a ServletConfig object.
      protected static WebAppManifest createManifest​(javax.servlet.ServletConfig config)
      Creates a new manifest from a ServletConfig object.
      void destroy()
      protected void doGet​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Serves the manifest as the response body.
      protected long getLastModified​(javax.servlet.http.HttpServletRequest request)
      WebAppManifest getManifest()
      Creates and returns a copy of the manifest.
      void init​(javax.servlet.ServletConfig config)
      void setManifest​(WebAppManifest newManifest)
      Sets the manifest.
      • Methods inherited from class javax.servlet.http.HttpServlet

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

        getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
    • Field Detail

      • NAME

        public static final String NAME
        Name of the initialization parameter for the name of the application.
        See Also:
        Constant Field Values
      • SHORT_NAME

        public static final String SHORT_NAME
        Name of the initialization parameter for the short name of the application.
        See Also:
        Constant Field Values
      • ICONS

        public static final String ICONS
        Name of the initialization parameter for the icons of the application.
        See Also:
        Constant Field Values
    • Constructor Detail

      • WebAppManifestServlet

        public WebAppManifestServlet()
    • Method Detail

      • getManifest

        public final WebAppManifest getManifest()
        Creates and returns a copy of the manifest.
        Returns:
        a copy of the manifest
      • setManifest

        public final void setManifest​(WebAppManifest newManifest)
        Sets the manifest.
        Parameters:
        newManifest - a new manifest
      • createManifest

        protected static WebAppManifest createManifest​(javax.servlet.ServletConfig config)
        Creates a new manifest from a ServletConfig object.
        Parameters:
        config - a ServletConfig object
        Returns:
        a new manifest
      • createIcons

        protected static ImageResource[] createIcons​(javax.servlet.ServletConfig config)
        Creates a new array of icons from a ServletConfig object.
        Parameters:
        config - a ServletConfig object
        Returns:
        a new array of icons
      • init

        public void init​(javax.servlet.ServletConfig config)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Servlet
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Servlet
        Overrides:
        destroy in class javax.servlet.GenericServlet
      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws IOException
        Serves the manifest as the response body.
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        IOException - if an I/O exception has occurred
      • getLastModified

        protected long getLastModified​(javax.servlet.http.HttpServletRequest request)
        Overrides:
        getLastModified in class javax.servlet.http.HttpServlet