Package org.vx68k.webapp.manifest
Class WebAppManifestServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.vx68k.webapp.manifest.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
andicons.*
- 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.
-
Constructor Summary
Constructors Constructor Description WebAppManifestServlet()
-
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 aServletConfig
object.protected static WebAppManifest
createManifest(javax.servlet.ServletConfig config)
Creates a new manifest from aServletConfig
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
-
-
-
-
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
-
-
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 aServletConfig
object.- Parameters:
config
- aServletConfig
object- Returns:
- a new manifest
-
createIcons
protected static ImageResource[] createIcons(javax.servlet.ServletConfig config)
Creates a new array of icons from aServletConfig
object.- Parameters:
config
- aServletConfig
object- Returns:
- a new array of icons
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
- Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classjavax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Servlet
- Overrides:
destroy
in classjavax.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 classjavax.servlet.http.HttpServlet
- Throws:
IOException
- if an I/O exception has occurred
-
getLastModified
protected long getLastModified(javax.servlet.http.HttpServletRequest request)
- Overrides:
getLastModified
in classjavax.servlet.http.HttpServlet
-
-