|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WebContext
Class to enable us to access servlet parameters.
WebContext is only available from a DWR thread. If you need to access web
data from a non-DWR thread, use the superclass, ServerContext
.
Field Summary | |
---|---|
static java.lang.String |
ATTRIBUTE_DWR
An attribute used by forwardToString(String) to inform
anyone that wants to know that this is a request from DWR. |
Method Summary | |
---|---|
java.lang.String |
forwardToString(java.lang.String url)
Forward a request to a given URL and catch the data written to it. |
java.lang.String |
getCurrentPage()
Returns the partial-URL of the page from which the current thread originated. |
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Accessor for the http request information. |
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
Accessor for the http response bean. |
ScriptSession |
getScriptSession()
Get the script session that represents the currently viewed page in the same way that an HttpSession represents a cookie. |
javax.servlet.http.HttpSession |
getSession()
Returns the current session associated with this request, or if the request does not have a session, creates one. |
javax.servlet.http.HttpSession |
getSession(boolean create)
Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session. |
Methods inherited from interface org.directwebremoting.ServerContext |
---|
getAllScriptSessions, getContainer, getContextPath, getScriptSessionById, getScriptSessionsByPage, getServletConfig, getServletContext, getVersion |
Field Detail |
---|
static final java.lang.String ATTRIBUTE_DWR
forwardToString(String)
to inform
anyone that wants to know that this is a request from DWR.
Method Detail |
---|
ScriptSession getScriptSession() throws java.lang.UnsupportedOperationException
If the DWR thread that gave rise to this WebContext
is as a
result of a JSON call, this method will throw an UnsupportedOperationException
java.lang.UnsupportedOperationException
- If this is part of a JSON calljava.lang.String getCurrentPage() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- If this is part of a JSON callfor details on how pages
are converted from external form to this form.
javax.servlet.http.HttpSession getSession()
HttpServletRequest.getSession()
javax.servlet.http.HttpSession getSession(boolean create)
create
- false to return null if there's no current session
HttpServletRequest.getSession(boolean)
javax.servlet.http.HttpServletRequest getHttpServletRequest()
javax.servlet.http.HttpServletResponse getHttpServletResponse()
You can't use this request to directly reply to the response or to add headers or cookies.
java.lang.String forwardToString(java.lang.String url) throws javax.servlet.ServletException, java.io.IOException
request.setAttribute(WebContext.ATTRIBUTE_DWR, Boolean.TRUE);
url
- The URL to forward to
java.io.IOException
- if the target resource throws this exception
javax.servlet.ServletException
- if the target resource throws this exception
java.lang.IllegalStateException
- if the response was already committed
|
Copyright ยจ 2008 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |