|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.directwebremoting.impl.DefaultServerContext
org.directwebremoting.impl.DefaultWebContext
public class DefaultWebContext
A default implementation of WebContext.
| Field Summary |
|---|
| Fields inherited from interface org.directwebremoting.WebContext |
|---|
ATTRIBUTE_DWR |
| Constructor Summary | |
|---|---|
DefaultWebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletConfig config,
javax.servlet.ServletContext context,
Container container)
Create a new DefaultWebContext |
|
| Method Summary | |
|---|---|
void |
checkPageInformation(java.lang.String sentPage,
java.lang.String sentScriptId,
java.lang.String windowName)
Fill in the page details from the servlet request. |
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. |
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 class org.directwebremoting.impl.DefaultServerContext |
|---|
getAllScriptSessions, getContainer, getContextPath, getScriptSessionById, getScriptSessionsByPage, getServletConfig, getServletContext, getVersion |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.directwebremoting.ServerContext |
|---|
getAllScriptSessions, getContainer, getContextPath, getScriptSessionById, getScriptSessionsByPage, getServletConfig, getServletContext, getVersion |
| Constructor Detail |
|---|
public DefaultWebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletConfig config,
javax.servlet.ServletContext context,
Container container)
request - The incoming http requestresponse - The outgoing http replyconfig - The servlet configurationcontext - The servlet contextcontainer - The IoC containerWebContextFactory.WebContextBuilder.set(HttpServletRequest, HttpServletResponse, ServletConfig, ServletContext, Container)| Method Detail |
|---|
public void checkPageInformation(java.lang.String sentPage,
java.lang.String sentScriptId,
java.lang.String windowName)
RealWebContextThis method should be used by anything that parses a batch, and then
allows either uses a WebContext or allows other things to use a
WebContext.
Caution Following this call, the passed
scriptSessionId may be wrong. scriptSessionIds can become invalid due to
server re-start, a timeout, or a back-button.
It seems wrong to throw a security exception, because it could
be totally innocent. So this method will create a new script session and
insert a script into the script session so that the page becomes synced
with the new ID at the earliest possible opportunity.
checkPageInformation in interface RealWebContext
sentPage - The URL of the current pagesentScriptId - The session id passed in by the browserwindowName - Reverse Ajax uses window.name to avoid 2 connection limit
public java.lang.String getCurrentPage()
WebContext
getCurrentPage in interface WebContextpublic ScriptSession getScriptSession()
WebContext
getScriptSession in interface WebContextpublic javax.servlet.http.HttpSession getSession()
WebContext
getSession in interface WebContextHttpServletRequest.getSession()public javax.servlet.http.HttpSession getSession(boolean create)
WebContext
getSession in interface WebContextcreate - false to return null if there's no current session
HttpServletRequest.getSession(boolean)public javax.servlet.http.HttpServletRequest getHttpServletRequest()
WebContext
getHttpServletRequest in interface WebContextpublic javax.servlet.http.HttpServletResponse getHttpServletResponse()
WebContextYou can't use this request to directly reply to the response or to add headers or cookies.
getHttpServletResponse in interface WebContext
public java.lang.String forwardToString(java.lang.String url)
throws javax.servlet.ServletException,
java.io.IOException
WebContextrequest.setAttribute(WebContext.ATTRIBUTE_DWR, Boolean.TRUE);
forwardToString in interface WebContexturl - The URL to forward to
javax.servlet.ServletException - if the target resource throws this exception
java.io.IOException - if the target resource throws this exception
|
Copyright ¬ 2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||