public class ResourceFileServlet
extends javax.servlet.http.HttpServlet
ResourceFileServlet is a copy of org.mortbay.jetty.servlet.DefaultServlet that
has been trimmed down to only support the subset of features that we want to take advantage of
(e.g. no gzipping, no chunked encoding, no buffering, etc.). A number of Jetty-specific
optimizations and assumptions have also been removed (e.g. use of custom header manipulation
API's, use of ByteArrayBuffer instead of Strings, etc.).
A few remaining Jetty-centric details remain, such as use of the ContextHandler.Context class, and Jetty-specific request attributes, but these are specific
cases where there is no servlet-engine-neutral API available. This class also uses Jetty's Resource class as a convenience, but could be converted to use ServletContext.getResource(String) instead.
| Constructor and Description |
|---|
ResourceFileServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Retrieve the static resource file indicated.
|
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
doTrace(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
init()
Initialize the servlet by extracting some useful configuration data from the current
ServletContext. |
protected boolean |
isProtectedPath(String target) |
doDelete, doHead, doOptions, doPut, getLastModified, service, servicepublic void init()
throws javax.servlet.ServletException
ServletContext.init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionprotected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doPost in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected void doTrace(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doTrace in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected boolean isProtectedPath(String target)
Copyright © 2022. All rights reserved.