|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webmacro.Context
org.webmacro.servlet.WebContext
This is an implementation of the WebContext interface. It has the ability to hook in commonly re-usable utilities via the configuraiton file for the Broker. These commonly re-usable utilities are then made available for use in the context. They include: Cookie, Form, FormList, and several others--see the WebMacro.properties file for the actual list, and a description of what's been loaded.
This class is made to be prototyped. You create a prototypical instance of the WebContext containing all the desired tools and a broker. You then use the newInstance(req,resp) method to create an instance of the WebContext to use versus a particular request.
IMPLEMENTATION NOTE: If you subclass this method you must provide a sensible implementation of the clone() method. This class uses clone() to create instances of the prototype in the newInstance method. You should also be sure and implement the clear() method as well.
Nested Class Summary |
Nested classes inherited from class org.webmacro.Context |
Context.TemplateEvaluationContext |
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
Constructor Summary | |
WebContext(Broker broker,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Construct a new WebContext. |
Method Summary | |
void |
clear()
Clear a WebContext of it's non-shared data |
CGI_Impersonator |
getCGI()
Get the CGI Tool |
javax.servlet.http.Cookie |
getCookie(java.lang.String name)
get a cookie from the request |
java.lang.String |
getForm(java.lang.String field)
Get the value of a form variable from the request |
java.lang.String[] |
getFormList(java.lang.String field)
Get the value of a form variable from the request as an array |
java.lang.Object |
getPossibleForm(java.lang.String strKey)
Try to get the value of a form variable from the request |
javax.servlet.http.HttpServletRequest |
getRequest()
The HttpServletRequest object which contains information provided by the HttpServlet superclass about the Request. |
javax.servlet.http.HttpServletResponse |
getResponse()
The HttpServletResponse object which contains information about the response we are going to send back. |
javax.servlet.http.HttpSession |
getSession()
get the session object |
void |
setCookie(java.lang.String name,
java.lang.String value)
send a cookie in the response |
Methods inherited from class org.webmacro.Context |
clone, cloneContext, containsKey, containsValue, entrySet, get, getBroker, getCurrentLocation, getEvaluationExceptionHandler, getLog, getLog, getMap, getProperty, getProperty, getTemplateEvaluationContext, internalGet, internalGet, isEmpty, keySet, put, put, put, put, put, put, put, put, put, put, putAll, putFunction, putGlobalFunction, remove, set, setEvaluationExceptionHandler, setMap, setProperty, setProperty, size, toString, values |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Constructor Detail |
public WebContext(Broker broker, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Method Detail |
public void clear()
clear
in interface java.util.Map
clear
in class Context
public final javax.servlet.http.HttpServletRequest getRequest()
HttpServletRequest
public final javax.servlet.http.HttpServletResponse getResponse()
HttpServletResponse
public final java.lang.Object getPossibleForm(java.lang.String strKey)
public final java.lang.String getForm(java.lang.String field)
public final java.lang.String[] getFormList(java.lang.String field)
public final CGI_Impersonator getCGI()
public final javax.servlet.http.Cookie getCookie(java.lang.String name)
public final void setCookie(java.lang.String name, java.lang.String value)
public final javax.servlet.http.HttpSession getSession()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |