public class ServletWrapper extends HttpServlet implements ServletContextListener
| Modifier and Type | Class and Description |
|---|---|
class |
ServletWrapper.ServletInvocation |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
IF_MODIFIED_SINCE |
static java.lang.String |
IF_NONE_MATCH |
static java.lang.String |
SERVLET_REQ
Constant for accessing the underlying HttpServletRequest from Play's Request
in a Servlet based deployment.
|
static java.lang.String |
SERVLET_RES
Constant for accessing the underlying HttpServletResponse from Play's Request
in a Servlet based deployment.
|
| Constructor and Description |
|---|
ServletWrapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
contextDestroyed(ServletContextEvent e) |
void |
contextInitialized(ServletContextEvent e) |
void |
copyResponse(Http.Request request,
Http.Response response,
HttpServletRequest servletRequest,
HttpServletResponse servletResponse) |
void |
destroy() |
protected static java.util.Map<java.lang.String,Http.Cookie> |
getCookies(HttpServletRequest httpServletRequest) |
protected static java.util.Map<java.lang.String,Http.Header> |
getHeaders(HttpServletRequest httpServletRequest) |
static boolean |
isGreaterThan(ServletContext context,
int majorVersion,
int minorVersion) |
static boolean |
isModified(java.lang.String etag,
java.lang.String lastDate,
HttpServletRequest request) |
static Http.Request |
parseRequest(HttpServletRequest httpServletRequest) |
void |
serve404(HttpServletRequest servletRequest,
HttpServletResponse servletResponse,
NotFound e) |
void |
serve500(java.lang.Exception e,
HttpServletRequest request,
HttpServletResponse response) |
void |
serveStatic(HttpServletResponse servletResponse,
HttpServletRequest servletRequest,
RenderStatic renderStatic) |
protected void |
service(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, servicegetInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, logpublic static final java.lang.String IF_MODIFIED_SINCE
public static final java.lang.String IF_NONE_MATCH
public static final java.lang.String SERVLET_REQ
Sample usage:
HttpServletRequest req = Request.current().args.get(ServletWrapper.SERVLET_REQ);
public static final java.lang.String SERVLET_RES
Sample usage:
HttpServletResponse res = Request.current().args.get(ServletWrapper.SERVLET_RES);
public void contextInitialized(ServletContextEvent e)
contextInitialized in interface ServletContextListenerpublic void contextDestroyed(ServletContextEvent e)
contextDestroyed in interface ServletContextListenerpublic void destroy()
destroy in interface Servletdestroy in class GenericServletpublic static boolean isGreaterThan(ServletContext context, int majorVersion, int minorVersion)
protected void service(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, java.io.IOException
service in class HttpServletServletExceptionjava.io.IOExceptionpublic void serveStatic(HttpServletResponse servletResponse, HttpServletRequest servletRequest, RenderStatic renderStatic) throws java.io.IOException
java.io.IOExceptionpublic static boolean isModified(java.lang.String etag,
java.lang.String lastDate,
HttpServletRequest request)
public static Http.Request parseRequest(HttpServletRequest httpServletRequest) throws java.lang.Exception
java.lang.Exceptionprotected static java.util.Map<java.lang.String,Http.Header> getHeaders(HttpServletRequest httpServletRequest)
protected static java.util.Map<java.lang.String,Http.Cookie> getCookies(HttpServletRequest httpServletRequest)
public void serve404(HttpServletRequest servletRequest, HttpServletResponse servletResponse, NotFound e)
public void serve500(java.lang.Exception e,
HttpServletRequest request,
HttpServletResponse response)
public void copyResponse(Http.Request request, Http.Response response, HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws java.io.IOException
java.io.IOExceptionGuillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly