Serializable
, javax.servlet.Servlet
, javax.servlet.ServletConfig
public final class StaticContentServlet extends HttpServlet
setRoot(java.io.File)
,
Serialized FormConstructor | Description |
---|---|
StaticContentServlet() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
|
protected long |
getLastModified(javax.servlet.http.HttpServletRequest request) |
|
void |
init() |
|
void |
setRoot(File root) |
Configures the file system
root for this servlet. |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
init
@InitParam(name="root") public void setRoot(File root)
root
for this servlet.
If root
is a directory, files will be served relative to the directory.
If root
is a file, only this file may be servedroot
- the file system root.public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected long getLastModified(javax.servlet.http.HttpServletRequest request)
getLastModified
in class javax.servlet.http.HttpServlet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
doGet
in class javax.servlet.http.HttpServlet
IOException
Copyright © 2018. All rights reserved.