protected class BaseServlet.Context extends java.lang.Object implements BaseServletContext
BaseServlet can extend this class to add their own
context variables.| Modifier and Type | Field and Description |
|---|---|
protected javax.servlet.http.HttpServletRequest |
request
The current HTTP request object.
|
int |
requestBrowser
The current user agent type.
|
int |
requestFlag
The current request flag.
|
protected javax.servlet.http.HttpServletResponse |
response
The current HTTP response object.
|
int |
responseFlag
The current response flag.
|
private static long |
serialVersionUID
The class' serialization version id.
|
javax.servlet.http.HttpSession |
session
The current servlet session.
|
java.util.Hashtable<java.lang.String,java.lang.String> |
sessionNextURL
The current session's set of next URL values.
|
org.apache.velocity.VelocityContext |
templateData
The current set of Velocity template data.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Context(javax.servlet.http.HttpServletRequest rqst,
javax.servlet.http.HttpServletResponse resp)
Constructs a new servlet context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delAttr(java.lang.String key)
A shortcut convenience method that removes an attribute value from the
current session.
|
java.lang.Object |
getAttr(java.lang.String key)
A shortcut convenience method that returns an attribute value from the
current session.
|
java.math.BigDecimal |
getAttrBigDecimal(java.lang.String key)
A shortcut convenience method that returns an attribute value from the
current session as a
BigDecimal. |
boolean |
getAttrBoolean(java.lang.String key)
A shortcut convenience method that returns an attribute value from the
current session as a
boolean. |
double |
getAttrDouble(java.lang.String key)
A shortcut convenience method that returns an attribute value from the
current session as a
double. |
int |
getAttrInteger(java.lang.String key)
A shortcut convenience method that returns an attribute value from the
current session as an
int. |
long |
getAttrLong(java.lang.String key)
A shortcut convenience method that returns an attribute value from the
current session as a
long. |
java.lang.String |
getAttrString(java.lang.String key)
A shortcut convenience method that returns an attribute value from the
current session as a
String. |
java.lang.String |
getParam(java.lang.String name)
A shortcut convenience method that returns a parameter value from the
current request.
|
java.math.BigDecimal |
getParamBigDecimal(java.lang.String name)
A shortcut convenience method that returns a parameter value from the
current request as a
BigDecimal. |
java.util.Date |
getParamDate(java.lang.String name)
A shortcut convenience method that returns a parameter value from the
current request as a
java.util.Date. |
double |
getParamDouble(java.lang.String name)
A shortcut convenience method that returns a parameter value from the
current request as a
double. |
int |
getParamInteger(java.lang.String name)
A shortcut convenience method that returns a parameter value from the
current request as an
int. |
long |
getParamLong(java.lang.String name)
A shortcut convenience method that returns a parameter value from the
current request as a
long. |
java.lang.String[] |
getParams(java.lang.String name)
A shortcut convenience method that returns an array of parameter values
from the current request.
|
java.lang.String |
getParamString(java.lang.String name)
A shortcut convenience method that returns a parameter value from the
current request as a
String. |
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the current servlet HTTP request.
|
javax.servlet.http.HttpServletResponse |
getResponse()
Returns the current servlet HTTP response.
|
javax.servlet.http.HttpSession |
getSession()
Returns the current servlet session.
|
boolean |
isPost()
Answers if a form has been posted by checking the current HTTP request's
method for "POST".
|
void |
setAttr(java.lang.String key,
java.lang.Object value)
A shortcut convenience method that sets an attribute value in the
current session.
|
private static final long serialVersionUID
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
public int requestFlag
public int responseFlag
public org.apache.velocity.VelocityContext templateData
public javax.servlet.http.HttpSession session
public java.util.Hashtable<java.lang.String,java.lang.String> sessionNextURL
public int requestBrowser
protected Context(javax.servlet.http.HttpServletRequest rqst,
javax.servlet.http.HttpServletResponse resp)
rqst - (HttpServletRequest) The servlet's incoming request.resp - (HttpServletResponse) The servlet's outgoing response.public void delAttr(java.lang.String key)
delAttr in interface BaseServletContextkey - (String) The key for the attribute value to remove.public java.lang.Object getAttr(java.lang.String key)
getAttr in interface BaseServletContextkey - (String) The key for the desired attribute value.null if a value for the key does not exist.public java.math.BigDecimal getAttrBigDecimal(java.lang.String key)
BigDecimal.getAttrBigDecimal in interface BaseServletContextkey - (String) The key for the desired attribute value.null if a value for the key does not exist or if the
key's value could not be converted to a BigDecimal.public boolean getAttrBoolean(java.lang.String key)
boolean.getAttrBoolean in interface BaseServletContextkey - (String) The key for the desired attribute value.false if a value for the key does not exist or if the
key's value could not be converted to a boolean.public double getAttrDouble(java.lang.String key)
double.getAttrDouble in interface BaseServletContextkey - (String) The key for the desired attribute value.public int getAttrInteger(java.lang.String key)
int.getAttrInteger in interface BaseServletContextkey - (String) The key for the desired attribute value.public long getAttrLong(java.lang.String key)
long.getAttrLong in interface BaseServletContextkey - (String) The key for the desired attribute value.public java.lang.String getAttrString(java.lang.String key)
String.getAttrString in interface BaseServletContextkey - (String) The key for the desired attribute value.public void setAttr(java.lang.String key,
java.lang.Object value)
setAttr in interface BaseServletContextkey - (String) The key associated with the value.value - (Object) The attribute value to set.public java.lang.String getParam(java.lang.String name)
getParam in interface BaseServletContextname - (String) The name of the desired parameter value.null if a value for the parameter name
does not exist.public java.lang.String[] getParams(java.lang.String name)
getParams in interface BaseServletContextname - (String) The name of the desired parameter values.null if a value for the parameter name
does not exist.public java.math.BigDecimal getParamBigDecimal(java.lang.String name)
BigDecimal.getParamBigDecimal in interface BaseServletContextname - (String) The name of the desired parameter value.BigDecimal.public java.util.Date getParamDate(java.lang.String name)
java.util.Date.getParamDate in interface BaseServletContextname - (String) The name of the desired parameter value.null if a value for the parameter name does
not exist or if the parameter value could not be converted to
a date.public double getParamDouble(java.lang.String name)
double.getParamDouble in interface BaseServletContextname - (String) The name of the desired parameter value.public int getParamInteger(java.lang.String name)
int.getParamInteger in interface BaseServletContextname - (String) The name of the desired parameter value.public long getParamLong(java.lang.String name)
long.getParamLong in interface BaseServletContextname - (String) The name of the desired parameter value.public java.lang.String getParamString(java.lang.String name)
String.getParamString in interface BaseServletContextname - (String) The name of the desired parameter value.public javax.servlet.http.HttpServletRequest getRequest()
getRequest in interface BaseServletContextpublic javax.servlet.http.HttpServletResponse getResponse()
getResponse in interface BaseServletContextpublic javax.servlet.http.HttpSession getSession()
getSession in interface BaseServletContextpublic boolean isPost()
isPost in interface BaseServletContexttrue if a form has been posted,
otherwise false.