|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mortbay.jetty.Request
public class Request
Jetty Request.
Implements HttpServletRequest
from the javax.servlet
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 behaviour. For example
getContextPath
method will return null, until the requeset has been
passed to a ContextHandler
which matches the getPathInfo
with a context
path and calls setContextPath
as a result.SessionHandler
which checks for session cookies
and enables the ability to create new sessions.getServletPath
method will return null until the request has been
passed to a ServletHandler
and the pathInfo matched
against the servlet URL patterns and setServletPath
called as a result.HttpConnection
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.
Constructor Summary | |
---|---|
Request(HttpConnection connection)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Request(HttpConnection connection)
Method Detail |
---|
protected void recycle()
public String getTimeStampStr()
public long getTimeStamp()
public void setTimeStamp(long ts)
public boolean isHandled()
public void setHandled(boolean h)
public Object getAttribute(String name)
public Enumeration getAttributeNames()
public String getAuthType()
public String getCharacterEncoding()
public int getContentLength()
public String getContentType()
public void setContentType(String contentType)
public String getContextPath()
public Cookie[] getCookies()
public long getDateHeader(String name)
public String getHeader(String name)
public Enumeration getHeaderNames()
public Enumeration getHeaders(String name)
public ServletInputStream getInputStream() throws IOException
IOException
public int getIntHeader(String name)
public String getLocalAddr()
public Locale getLocale()
public Enumeration getLocales()
public String getLocalName()
public int getLocalPort()
public String getMethod()
public String getParameter(String name)
public Map getParameterMap()
public Enumeration getParameterNames()
public String[] getParameterValues(String name)
public String getPathInfo()
public String getPathTranslated()
public String getProtocol()
public BufferedReader getReader() throws IOException
IOException
public String getRealPath(String path)
public String getRemoteAddr()
public String getRemoteHost()
public int getRemotePort()
public String getRemoteUser()
public RequestDispatcher getRequestDispatcher(String path)
public String getRequestedSessionId()
public String getRequestURI()
public StringBuffer getRequestURL()
public String getScheme()
public String getServerName()
public int getServerPort()
public String getServletPath()
public String getServletName()
public HttpSession getSession()
public HttpSession getSession(boolean create)
public Principal getUserPrincipal()
public String getQueryString()
public boolean isRequestedSessionIdFromCookie()
public boolean isRequestedSessionIdFromUrl()
public boolean isRequestedSessionIdFromURL()
public boolean isRequestedSessionIdValid()
public boolean isSecure()
public boolean isUserInRole(String role)
public void removeAttribute(String name)
public void setAttribute(String name, Object value)
public void setCharacterEncoding(String encoding) throws UnsupportedEncodingException
UnsupportedEncodingException
public void setCharacterEncodingUnchecked(String encoding)
public void setServerName(String host)
host
- The host to set.public HttpURI getUri()
public void setUri(HttpURI uri)
uri
- The uri to set.public HttpConnection getConnection()
public int getInputState()
public void setAuthType(String authType)
authType
- The authType to set.public void setCookies(Cookie[] cookies)
cookies
- The cookies to set.public void setMethod(String method)
method
- The method to set.public void setPathInfo(String pathInfo)
pathInfo
- The pathInfo to set.public void setProtocol(String protocol)
protocol
- The protocol to set.public void setRequestedSessionId(String requestedSessionId)
requestedSessionId
- The requestedSessionId to set.public SessionManager getSessionManager()
public void setSessionManager(SessionManager sessionManager)
sessionManager
- The sessionManager to set.public void setRequestedSessionIdFromCookie(boolean requestedSessionIdCookie)
requestedSessionIdCookie
- The requestedSessionIdCookie to set.public void setSession(HttpSession session)
session
- The session to set.public void setScheme(String scheme)
scheme
- The scheme to set.public void setQueryString(String queryString)
queryString
- The queryString to set.public void setRequestURI(String requestURI)
requestURI
- The requestURI to set.public void setContextPath(String contextPath)
HttpServletRequest#getContextPath
public void setServletPath(String servletPath)
servletPath
- The servletPath to set.public void setServletName(String name)
name
- The servletName to set.public void setUserPrincipal(Principal userPrincipal)
userPrincipal
- The userPrincipal to set.public void setContext(ContextHandler.SContext context)
context
- public ContextHandler.SContext getContext()
context
used for this request, or null
if setContext(org.mortbay.jetty.handler.ContextHandler.SContext)
has not yet
been called.public StringBuffer getRootURL()
Because this method returns a StringBuffer
, not a string, you can modify the
URL easily, for example, to append path and query parameters.
This method is useful for creating redirect messages and for reporting errors.
public Attributes getAttributes()
public void setAttributes(Attributes attributes)
public Continuation getContinuation()
public Continuation getContinuation(boolean create)
public MultiMap getParameters()
public void setParameters(MultiMap parameters)
parameters
- The parameters to set.public String toString()
toString
in class Object
public static Request getRequest(HttpServletRequest request)
public void addEventListener(EventListener listener)
public void removeEventListener(EventListener listener)
public void saveNewSession(Object key, HttpSession session)
public HttpSession recoverNewSession(Object key)
public UserRealm getUserRealm()
public void setUserRealm(UserRealm userRealm)
userRealm
- The userRealm to set.public String getQueryEncoding()
public void setQueryEncoding(String queryEncoding)
queryEncoding
- public void setRoleMap(Map map)
public Map getRoleMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |