|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.liquidsite.core.web.Request
An HTTP request and response.
| Nested Class Summary | |
static interface |
Request.FileParameter
A request file parameter. |
| Constructor Summary | |
Request(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Creates a new request. |
|
| Method Summary | |
void |
commit(javax.servlet.ServletContext context,
boolean content)
Sends the request response to the underlying HTTP response object. |
void |
dispose()
Disposes of all resources used by this request object. |
java.util.Map |
getAllAttributes()
Returns all the request attributes in a map. |
java.util.Map |
getAllParameters()
Returns a map with all the request parameter names and values. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the value of a request attribute. |
java.lang.Object |
getAttribute(java.lang.String name,
java.lang.Object defVal)
Returns the value of a request attribute. |
RequestEnvironment |
getEnvironment()
Returns the request environment object. |
Request.FileParameter |
getFileParameter(java.lang.String name)
Returns the specified file request parameter. |
java.lang.String |
getHost()
Returns the host name in the request. |
java.lang.String |
getParameter(java.lang.String name)
Returns the value of a request parameter. |
java.lang.String |
getParameter(java.lang.String name,
java.lang.String defVal)
Returns the value of a request parameter. |
java.lang.String |
getPath()
Returns the request path with file name. |
int |
getPort()
Returns the port number in the request. |
java.lang.String |
getProtocol()
Returns the protocol name in the request, i.e. |
java.lang.String |
getRemoteAddr()
Returns the IP address of the request sender. |
javax.servlet.ServletContext |
getServletContext()
Returns the servlet context. |
java.lang.String |
getServletPath()
Returns the servlet portion of the request path. |
RequestSession |
getSession()
Returns the request session. |
java.lang.String |
getUrl()
Returns the full request URL with protocol, hostname and path. |
User |
getUser()
Returns the session user. |
boolean |
hasResponse()
Checks if this request contains a response. |
void |
sendData(java.lang.String mimeType,
java.lang.String data)
Sends the specified data as the request response. |
void |
sendFile(java.io.File file,
boolean limitCache)
Sends the contents of a file as the request response. |
void |
sendRedirect(java.lang.String location)
Redirects this request by sending a temporary redirection URL to the browser. |
void |
setAttribute(java.lang.String name,
boolean value)
Sets a request attribute value. |
void |
setAttribute(java.lang.String name,
int value)
Sets a request attribute value. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets a request attribute value. |
void |
setUser(User user)
Sets the session user. |
java.lang.String |
toString()
Returns a string representation of this request. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Request(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
context - the servlet contextrequest - the HTTP requestresponse - the HTTP response| Method Detail |
public java.lang.String toString()
public boolean hasResponse()
public java.lang.String getProtocol()
public java.lang.String getHost()
public int getPort()
public java.lang.String getPath()
public javax.servlet.ServletContext getServletContext()
public java.lang.String getServletPath()
public java.lang.String getUrl()
public java.lang.String getRemoteAddr()
public java.lang.Object getAttribute(java.lang.String name)
name - the attribute name
public java.lang.Object getAttribute(java.lang.String name,
java.lang.Object defVal)
name - the attribute namedefVal - the default attribute value
public java.util.Map getAllAttributes()
public void setAttribute(java.lang.String name,
java.lang.Object value)
name - the attribute namevalue - the attribute value
public void setAttribute(java.lang.String name,
boolean value)
name - the attribute namevalue - the attribute value
public void setAttribute(java.lang.String name,
int value)
name - the attribute namevalue - the attribute valuepublic java.util.Map getAllParameters()
public java.lang.String getParameter(java.lang.String name)
name - the request parameter name
public java.lang.String getParameter(java.lang.String name,
java.lang.String defVal)
name - the request parameter namedefVal - the default parameter value
public Request.FileParameter getFileParameter(java.lang.String name)
name - the request parameter name
public User getUser()
setUser(org.liquidsite.core.content.User)public void setUser(User user)
user - the new session user, or null to logoutgetUser()public RequestEnvironment getEnvironment()
public RequestSession getSession()
public void sendData(java.lang.String mimeType,
java.lang.String data)
mimeType - the data MIME typedata - the data to send
public void sendFile(java.io.File file,
boolean limitCache)
file - the file containing the responselimitCache - the limited cache flagpublic void sendRedirect(java.lang.String location)
location - the destination locationpublic void dispose()
public void commit(javax.servlet.ServletContext context,
boolean content)
throws java.io.IOException,
javax.servlet.ServletException
context - the servlet contextcontent - the complete content response flag
java.io.IOException - if an IO error occured while attempting to
commit the response
javax.servlet.ServletException - if a configuration error was
encountered while sending the response
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||