Package play.server
Class ServletWrapper
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- play.server.ServletWrapper
-
- All Implemented Interfaces:
java.io.Serializable,java.util.EventListener,javax.servlet.Servlet,javax.servlet.ServletConfig,javax.servlet.ServletContextListener
public class ServletWrapper extends javax.servlet.http.HttpServlet implements javax.servlet.ServletContextListenerServlet implementation. Thanks to Lee Breisacher.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classServletWrapper.ServletInvocation
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringIF_MODIFIED_SINCEstatic java.lang.StringIF_NONE_MATCHstatic java.lang.StringSERVLET_REQConstant for accessing the underlying HttpServletRequest from Play's Request in a Servlet based deployment.static java.lang.StringSERVLET_RESConstant for accessing the underlying HttpServletResponse from Play's Request in a Servlet based deployment.
-
Constructor Summary
Constructors Constructor Description ServletWrapper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontextDestroyed(javax.servlet.ServletContextEvent e)voidcontextInitialized(javax.servlet.ServletContextEvent e)voidcopyResponse(Http.Request request, Http.Response response, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)voiddestroy()protected static java.util.Map<java.lang.String,Http.Cookie>getCookies(javax.servlet.http.HttpServletRequest httpServletRequest)protected static java.util.Map<java.lang.String,Http.Header>getHeaders(javax.servlet.http.HttpServletRequest httpServletRequest)static booleanisGreaterThan(javax.servlet.ServletContext context, int majorVersion, int minorVersion)static booleanisModified(java.lang.String etag, long last, javax.servlet.http.HttpServletRequest request)static Http.RequestparseRequest(javax.servlet.http.HttpServletRequest httpServletRequest)voidserve404(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, NotFound e)voidserve500(java.lang.Exception e, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidserveStatic(javax.servlet.http.HttpServletResponse servletResponse, javax.servlet.http.HttpServletRequest servletRequest, RenderStatic renderStatic)protected voidservice(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Field Detail
-
IF_MODIFIED_SINCE
public static final java.lang.String IF_MODIFIED_SINCE
- See Also:
- Constant Field Values
-
IF_NONE_MATCH
public static final java.lang.String IF_NONE_MATCH
- See Also:
- Constant Field Values
-
SERVLET_REQ
public static final java.lang.String SERVLET_REQ
Constant for accessing the underlying HttpServletRequest from Play's Request in a Servlet based deployment.Sample usage:
HttpServletRequest req = Request.current().args.get(ServletWrapper.SERVLET_REQ);- See Also:
- Constant Field Values
-
SERVLET_RES
public static final java.lang.String SERVLET_RES
Constant for accessing the underlying HttpServletResponse from Play's Request in a Servlet based deployment.Sample usage:
HttpServletResponse res = Request.current().args.get(ServletWrapper.SERVLET_RES);- See Also:
- Constant Field Values
-
-
Method Detail
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent e)
- Specified by:
contextInitializedin interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent e)
- Specified by:
contextDestroyedin interfacejavax.servlet.ServletContextListener
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Servlet- Overrides:
destroyin classjavax.servlet.GenericServlet
-
isGreaterThan
public static boolean isGreaterThan(javax.servlet.ServletContext context, int majorVersion, int minorVersion)
-
service
protected void service(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws javax.servlet.ServletException, java.io.IOException- Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionjava.io.IOException
-
serveStatic
public void serveStatic(javax.servlet.http.HttpServletResponse servletResponse, javax.servlet.http.HttpServletRequest servletRequest, RenderStatic renderStatic) throws java.io.IOException- Throws:
java.io.IOException
-
isModified
public static boolean isModified(java.lang.String etag, long last, javax.servlet.http.HttpServletRequest request)
-
parseRequest
public static Http.Request parseRequest(javax.servlet.http.HttpServletRequest httpServletRequest) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getHeaders
protected static java.util.Map<java.lang.String,Http.Header> getHeaders(javax.servlet.http.HttpServletRequest httpServletRequest)
-
getCookies
protected static java.util.Map<java.lang.String,Http.Cookie> getCookies(javax.servlet.http.HttpServletRequest httpServletRequest)
-
serve404
public void serve404(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, NotFound e)
-
serve500
public void serve500(java.lang.Exception e, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
copyResponse
public void copyResponse(Http.Request request, Http.Response response, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse) throws java.io.IOException
- Throws:
java.io.IOException
-
-