|
SimpleServlets v5.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.simpleservlets.pageprocessor.PageContext
public class PageContext
Encapsulates the context for this page request/response cycle. There are multiple public member variables which can be directly accessed (they are also declared final). There are also many convenience methods for accessing common information.
| Field Summary | |
|---|---|
ValueMap |
param
The ValueMap for the "request parameters". |
PageProcessor |
processor
The PageProcessor that created this PageContext to
handle an incoming request. |
HttpServletRequest |
request
The raw request that came in. |
String |
requestedPage
The name of the page that was requested. |
HttpServletResponse |
response
The raw response for this request/response cycle. |
Session |
session
The PageProcessor user Session that is associated with the
current request. |
ValueMap |
ss
The ValueMap for the "session store". |
| Constructor Summary | |
|---|---|
PageContext(HttpServletRequest request,
HttpServletResponse response,
Session session,
String requestedPage,
PageProcessor processor)
Used primarily by PageProcessor to create a context to pass when each request comes in. |
|
| Method Summary | |
|---|---|
ValueMap |
getCookieMap()
Returns a ValueMap with keys being the cookies' names and
values being the cookies. |
ValueMap |
getCookieValueMap()
Returns a ValueMap with keys being the cookies' names and
values being the cookies' values (using getValue() on
each cookie). |
String |
getPageURI(PageHandler handler)
Returns a URI which includes the session/sequence information and the page name for the specified handler. |
String |
getPageURI(PageHandler handler,
ParameterList paramList)
Returns a URI which includes the session/sequence information and the page name for the specified handler and the specified parameters. |
String |
getPageURI(PageHandler handler,
String paramKey,
int paramValue)
Returns a URI which includes the session/sequence information and the page name for the specified handler and the specified single parameter. |
String |
getPageURI(PageHandler handler,
String paramKey,
Object paramValue)
Returns a URI which includes the session/sequence information and the page name for the specified handler and the specified single parameter. |
String |
getPageURI(PageHandler handler,
String paramKey,
String paramValue)
Returns a URI which includes the session/sequence information and the page name for the specified handler and the specified single parameter. |
String |
getPageURI(String pageName)
Returns a URI which includes the session/sequence information and the specified page name. |
String |
getPageURI(String pageName,
ParameterList paramList)
Returns a URI which includes the session/sequence information and the specified page name and the specified parameters. |
String |
getPageURI(String pageName,
String paramKey,
int paramValue)
Returns a URI which includes the session/sequence information and the specified page name and the specified single parameter. |
String |
getPageURI(String pageName,
String paramKey,
Object paramValue)
Returns a URI which includes the session/sequence information and the specified page name and the specified single parameter. |
String |
getPageURI(String pageName,
String paramKey,
String paramValue)
Returns a URI which includes the session/sequence information and the specified page name and the specified single parameter. |
Value |
getParameter(String parameterName)
|
ValueMap |
getParameterMap()
|
ServletConfig |
getServletConfig()
|
ServletContext |
getServletContext()
|
ValueMap |
getSessionStore()
Returns the session-specific storage map from the session. |
Value |
getSessionValue(String sessionStoreKey)
Returns the Value stored in the Session
for the required key specified. |
Exception |
getUncaughtException()
Returns the exception stored for this request/response cycle (if any). |
String |
getWebAppURI()
Returns the base URI for the whole web application (the root of the WAR-file). |
boolean |
isReload()
Shortcut for isReload() on Session. |
void |
log(String message)
Logs to the servlet container's log file. |
void |
log(String message,
Throwable t)
Logs to the servlet container's log file. |
void |
setUncaughtException(Exception uncaughtException)
Specifies an exception that has not been caught. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final Session session
Session that is associated with the
current request.
public final ValueMap ss
ValueMap for the "session store". Shortcut for
getSessionStore() on Session.
public final ValueMap param
ValueMap for the "request parameters". Shortcut for
getParameterMap().
public final String requestedPage
public final PageProcessor processor
PageProcessor that created this PageContext to
handle an incoming request.
public final HttpServletRequest request
public final HttpServletResponse response
| Constructor Detail |
|---|
public PageContext(HttpServletRequest request,
HttpServletResponse response,
Session session,
String requestedPage,
PageProcessor processor)
| Method Detail |
|---|
public ValueMap getParameterMap()
public Value getParameter(String parameterName)
public ValueMap getCookieMap()
ValueMap with keys being the cookies' names and
values being the cookies. Use this method if you need access to
more information on the cookie beyond just the cookie's name
and value (from getValue() on Cookie).
If you are only concerned with a cookie's value, then
getCookieValueMap() is likely to be more convenient.
getCookieValueMap()public ValueMap getCookieValueMap()
ValueMap with keys being the cookies' names and
values being the cookies' values (using getValue() on
each cookie). Use this method if you need access to just the value
information on the cookie.
If you are concerned with more than a cookie's value, then
getCookieMap() is likely to be more convenient.
getCookieMap()public boolean isReload()
isReload() on Session.
public String getPageURI(String pageName)
throws PageProcessorException
PageProcessorException - if no page can be found with the
specified name.
public String getPageURI(String pageName,
ParameterList paramList)
throws PageProcessorException
PageProcessorException - if no page can be found with the
specified name.
public String getPageURI(String pageName,
String paramKey,
String paramValue)
throws PageProcessorException
PageProcessorException - if no page can be found with the
specified name.
public String getPageURI(String pageName,
String paramKey,
int paramValue)
throws PageProcessorException
PageProcessorException - if no page can be found with the
specified name.
public String getPageURI(String pageName,
String paramKey,
Object paramValue)
throws PageProcessorException
PageProcessorException - if no page can be found with the
specified name.
public String getPageURI(PageHandler handler)
throws PageProcessorException
returngetPageURI(processor.getPageName(handler));
PageProcessorException - if there are problems finding the name
for the specified handler.
public String getPageURI(PageHandler handler,
ParameterList paramList)
throws PageProcessorException
returngetPageURI(processor.getPageName(handler), paramList);
PageProcessorException - if there are problems finding the name
for the specified handler.
public String getPageURI(PageHandler handler,
String paramKey,
String paramValue)
throws PageProcessorException
returngetPageURI(processor.getPageName(handler), paramKey, paramValue);
PageProcessorException - if there are problems finding the name
for the specified handler.
public String getPageURI(PageHandler handler,
String paramKey,
int paramValue)
throws PageProcessorException
returngetPageURI(processor.getPageName(handler), paramKey, paramValue);
PageProcessorException - if there are problems finding the name
for the specified handler.
public String getPageURI(PageHandler handler,
String paramKey,
Object paramValue)
throws PageProcessorException
returngetPageURI(processor.getPageName(handler), paramKey, paramValue);
PageProcessorException - if there are problems finding the name
for the specified handler.public String getWebAppURI()
public Exception getUncaughtException()
public void setUncaughtException(Exception uncaughtException)
public void log(String message,
Throwable t)
public void log(String message)
public ServletContext getServletContext()
public ServletConfig getServletConfig()
public ValueMap getSessionStore()
public Value getSessionValue(String sessionStoreKey)
throws ValueMapRequiredKeyException
Value stored in the Session
for the required key specified.
ValueMapRequiredKeyException
|
SimpleServlets v5.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||