|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jzeno.aop.ServletSupport
public class ServletSupport
This class allows you access to low level objects from the Servlet API. The methods in this class can be called from any part of your application code.
Field Summary | |
---|---|
static java.lang.String |
APPLICATION_SESSION_ATTRIBUTES
|
static java.lang.String |
NAVIGATE
|
static java.lang.String |
PREFIX_NAVIGATION
|
Constructor Summary | |
---|---|
ServletSupport()
|
Method Summary | |
---|---|
static void |
addError(Component c,
java.lang.String key)
Adds an error to the top of the page. |
static void |
addError(Component c,
java.lang.String key,
java.lang.Object[] args)
Adds an error to the top of the page. |
static void |
addError(java.lang.String key)
Adds an error to the top of the page. |
static void |
addError(java.lang.String key,
java.lang.Object[] args)
Adds an error to the top of the page. |
static void |
addMessage(Component c,
java.lang.String key)
Adds a message to the top of the page. |
static void |
addMessage(Component c,
java.lang.String key,
java.lang.Object[] args)
Adds a message to the top of the page. |
static void |
addMessage(java.lang.String key)
Adds a message to the top of the page. |
static void |
addMessage(java.lang.String key,
java.lang.Object[] args)
Adds a message to the top of the page. |
static void |
addWarning(Component c,
java.lang.String key)
Adds a warning to the top of the page. |
static void |
addWarning(Component c,
java.lang.String key,
java.lang.Object[] args)
Adds a warning to the top of the page. |
static void |
addWarning(java.lang.String key)
Adds a warning to the top of the page. |
static void |
addWarning(java.lang.String key,
java.lang.Object[] args)
Adds a warning to the top of the page. |
static void |
clearErrorsAndMessages()
Clear all pending errors and messages. |
static Connection |
getConnection()
|
static java.lang.String |
getDirectRemoteHost()
Retrieve the remote IP address. |
static java.util.List |
getErrors()
|
static java.util.List |
getErrors(Component c)
|
static java.util.List |
getErrorsList()
|
static java.util.Map |
getErrorsMap()
|
static java.util.List |
getGlobalMessagesList()
Gets a list of currently pending application messages. |
static java.util.List |
getMessages()
|
static java.util.List |
getMessages(Component c)
|
static java.util.List |
getPreviousMessages()
Retrieve the last displayed errors,messages and/or warnings. |
static java.lang.String |
getRemoteHost()
Retrieve the remote IP address. |
static javax.servlet.http.HttpServletRequest |
getRequest()
|
static java.lang.Object |
getRequestAttribute(java.lang.String attribute)
Gets a request attribute. |
static java.lang.String |
getRequestHeader(java.lang.String name)
Gets a request header, such as User-Agent to determine the browser type... |
static java.lang.String |
getRequestParameter(java.lang.String parameter)
Get a request parameters. |
static java.lang.String[] |
getRequestParameterNames()
Gets the list of request parameters. |
static java.lang.String |
getRequestURI()
Retrieves the request URI. |
static javax.servlet.http.HttpServletResponse |
getResponse()
|
static javax.servlet.ServletConfig |
getServletConfig()
|
static javax.servlet.ServletContext |
getServletContext()
|
static javax.servlet.http.HttpSession |
getSession()
|
static java.lang.Object |
getSessionAttribute(java.lang.String attribute)
Gets a session attribute. |
static java.lang.String |
getSessionId()
Gets the session id. |
static java.util.List |
getWarnings()
|
static java.util.List |
getWarnings(Component c)
|
static java.util.Map |
getWarningsMap()
|
static void |
removeSessionAttribute(java.lang.String attribute)
Removes a session attribute. |
static void |
setContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
|
static void |
setContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
Connection conn)
|
static void |
setRequestAttribute(java.lang.String attribute,
java.lang.Object value)
Sets a request attribute. |
static void |
setServletConfig(javax.servlet.ServletConfig config)
|
static void |
setServletContext(javax.servlet.ServletContext context)
|
static void |
setSessionAttribute(java.lang.String attribute,
java.lang.Object value)
Sets a session attribute. |
static java.lang.String |
translate(java.lang.String key)
|
static java.lang.String |
translate(java.lang.String key,
java.lang.Object[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NAVIGATE
public static final java.lang.String PREFIX_NAVIGATION
public static final java.lang.String APPLICATION_SESSION_ATTRIBUTES
Constructor Detail |
---|
public ServletSupport()
Method Detail |
---|
public static void setContext(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
public static void setContext(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, Connection conn)
public static javax.servlet.http.HttpServletRequest getRequest()
public static javax.servlet.http.HttpServletResponse getResponse()
public static javax.servlet.http.HttpSession getSession()
public static javax.servlet.ServletContext getServletContext()
public static void setServletContext(javax.servlet.ServletContext context)
public static javax.servlet.ServletConfig getServletConfig()
public static void setServletConfig(javax.servlet.ServletConfig config)
public static java.lang.Object getSessionAttribute(java.lang.String attribute)
Gets a session attribute.
public static void setSessionAttribute(java.lang.String attribute, java.lang.Object value)
Sets a session attribute.
public static void removeSessionAttribute(java.lang.String attribute)
Removes a session attribute.
public static java.lang.String getRequestParameter(java.lang.String parameter)
Get a request parameters.
public static void setRequestAttribute(java.lang.String attribute, java.lang.Object value)
Sets a request attribute.
public static java.lang.Object getRequestAttribute(java.lang.String attribute)
Gets a request attribute.
public static java.lang.String getRequestURI()
Retrieves the request URI.
public static java.lang.String getRequestHeader(java.lang.String name)
Gets a request header, such as User-Agent to determine the browser type...
public static java.lang.String getRemoteHost()
Retrieve the remote IP address. If forwarded by proxy return X-Forwarded-For
public static java.lang.String getDirectRemoteHost()
Retrieve the remote IP address. It allways return the IP address on the other side of the request's TCP/IP connection !
public static java.lang.String getSessionId()
Gets the session id.
public static java.util.List getGlobalMessagesList()
Gets a list of currently pending application messages.
public static java.util.Map getErrorsMap()
public static java.util.Map getWarningsMap()
public static java.util.List getMessages(Component c)
public static java.util.List getWarnings(Component c)
public static java.util.List getErrors(Component c)
public static java.util.List getErrors()
public static java.util.List getErrorsList()
public static java.util.List getWarnings()
public static java.util.List getMessages()
public static void clearErrorsAndMessages()
Clear all pending errors and messages.
public static java.lang.String translate(java.lang.String key)
public static java.lang.String translate(java.lang.String key, java.lang.Object[] args)
public static void addMessage(java.lang.String key)
Adds a message to the top of the page. You supply a resource key that is used to identify the real message (in i18n.properties).
public static void addMessage(java.lang.String key, java.lang.Object[] args)
Adds a message to the top of the page. You supply a resource key that is used to identify the real message (in i18n.properties).
public static void addWarning(java.lang.String key)
Adds a warning to the top of the page. You supply a resource key that is used to identify the real warning (in i18n.properties).
public static void addWarning(java.lang.String key, java.lang.Object[] args)
Adds a warning to the top of the page. You supply a resource key that is used to identify the real warning (in i18n.properties).
public static void addError(java.lang.String key)
Adds an error to the top of the page. You supply a resource key that is used to identify the real message (in i18n.properties).
public static void addError(java.lang.String key, java.lang.Object[] args)
Adds an error to the top of the page. You supply a resource key that is used to identify the real message (in i18n.properties). Param0 is substituted for {0}.
public static void addMessage(Component c, java.lang.String key)
Adds a message to the top of the page. You supply a resource key that is used to identify the real message (in i18n.properties).
public static void addMessage(Component c, java.lang.String key, java.lang.Object[] args)
Adds a message to the top of the page. You supply a resource key that is used to identify the real message (in i18n.properties).
public static void addWarning(Component c, java.lang.String key)
Adds a warning to the top of the page. You supply a resource key that is used to identify the real warning (in i18n.properties).
public static void addWarning(Component c, java.lang.String key, java.lang.Object[] args)
Adds a warning to the top of the page. You supply a resource key that is used to identify the real warning (in i18n.properties).
public static void addError(Component c, java.lang.String key)
Adds an error to the top of the page. You supply a resource key that is used to identify the real message (in i18n.properties).
public static void addError(Component c, java.lang.String key, java.lang.Object[] args)
Adds an error to the top of the page. You supply a resource key that is used to identify the real message (in i18n.properties). Param0 is substituted for {0}.
public static java.lang.String[] getRequestParameterNames()
Gets the list of request parameters.
public static Connection getConnection()
public static java.util.List getPreviousMessages()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |