|
|||||||||
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.
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()
What is the URL of the current page. |
HttpServletRequest |
getHttpServletRequest()
Accessor for the http request information. |
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. |
HttpSession |
getSession()
Returns the current session associated with this request, or if the request does not have a session, creates one. |
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. |
void |
setCurrentPageInformation(java.lang.String page,
java.lang.String scriptSessionId)
For system use only: This method allows the system to fill in the session id and page id when they are discovered. |
Methods inherited from interface org.directwebremoting.ServerContext |
---|
getAllScriptSessions, getContainer, 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()
java.lang.String getCurrentPage()
HttpSession getSession()
HttpServletRequest#getSession()
HttpSession getSession(boolean create)
create
- false to return null if there's no current session
HttpServletRequest#getSession(boolean)
HttpServletRequest getHttpServletRequest()
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 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
ServletException
- if the target resource throws this exception
java.lang.IllegalStateException
- if the response was already committedvoid setCurrentPageInformation(java.lang.String page, java.lang.String scriptSessionId)
page
- The URL of the current pagescriptSessionId
- The session id passed in by the browser
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |