Jetty Request.
Implements {@link javax.servlet.http.HttpServletRequest} from the javax.servlet.http
package.
The standard interface of mostly getters, is extended with setters so that the request is mutable by the handlers that it is passed to. This allows the request object to be as lightweight as possible and not actually implement any significant behavior. For example
- The {@link Request#getContextPath()} method will return null, until the request has been passed to a {@link ContextHandler} which matches the{@link Request#getPathInfo()} with a context path and calls {@link Request#setContextPath(String)} as a result.
- the HTTP session methods will all return null sessions until such time as a request has been passed to a {@link org.eclipse.jetty.server.session.SessionHandler} which checks for session cookies and enables the ability to create new sessions.
- The {@link Request#getServletPath()} method will return null until the request has been passed to a
org.eclipse.jetty.servlet.ServletHandler
and the pathInfo matched against the servlet URL patterns and {@link Request#setServletPath(String)} called as a result.
A request instance is created for each connection accepted by the server and recycled for each HTTP request received via that connection. An effort is made to avoid reparsing headers and cookies that are likely to be the same for requests from the same connection.
The form content that a request can process is limited to protect from Denial of Service attacks. The size in bytes is limited by {@link ContextHandler#getMaxFormContentSize()} or if there is no context then the "org.eclipse.jetty.server.Request.maxFormContentSize" {@link Server}attribute. The number of parameters keys is limited by {@link ContextHandler#getMaxFormKeys()} or if there is no context then the"org.eclipse.jetty.server.Request.maxFormKeys" {@link Server} attribute.