org.apache.cocoon.components.language.markup.xsp
Class XSPRequestHelper

java.lang.Object
  |
  +--org.apache.cocoon.components.language.markup.xsp.XSPRequestHelper

public class XSPRequestHelper
extends java.lang.Object

The Request object helper

Version:
CVS $Revision: 1.5.2.8 $ $Date: 2001/10/23 09:58:19 $
Author:
Ricardo Rocha

Constructor Summary
XSPRequestHelper()
           
 
Method Summary
static java.lang.Object getAttribute(java.util.Map objectModel, java.lang.String name)
          Get the specified attribute
static void getAttributeNames(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Output attribute names for a given request
static java.lang.String getContextPath(java.util.Map objectModel)
          Obtain the portion of the request URI that indicates the context of the request
static void getContextPath(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Obtain the portion of the request URI that indicates the context of the request
static void getHeader(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler, java.lang.String name)
          Output the request header value for a given name
static java.lang.String getHeader(java.util.Map objectModel, java.lang.String name)
          Return the request header value for a given name
static void getHeaderNames(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Output the header names for a given request
static java.lang.String getMethod(java.util.Map objectModel)
          Output the name of the HTTP method with which the request was made,
static void getMethod(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Output the name of the HTTP method with which the request was made,
static void getParameter(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler, java.lang.String name, java.lang.String defaultValue)
          Output the given request parameter value or a user-provided default if none was specified.
static void getParameter(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler, java.lang.String name, java.lang.String defaultValue, java.lang.String form_encoding, java.lang.String container_encoding)
          Output the given request parameter value or a user-provided default if none was specified.
static java.lang.String getParameter(java.util.Map objectModel, java.lang.String name, java.lang.String defaultValue)
          Return the given request parameter value or a user-provided default if none was specified.
static java.lang.String getParameter(java.util.Map objectModel, java.lang.String name, java.lang.String defaultValue, java.lang.String form_encoding, java.lang.String container_encoding)
          Return the given request parameter value or a user-provided default if none was specified.
static void getParameterNames(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Output parameter names for a given request
static void getParameterValues(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler, java.lang.String name)
          Output the request parameter values for a given name
static void getParameterValues(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler, java.lang.String name, java.lang.String form_encoding, java.lang.String container_encoding)
          Output the request parameter values for a given name
static java.lang.String[] getParameterValues(java.util.Map objectModel, java.lang.String name, java.lang.String form_encoding, java.lang.String container_encoding)
          return the request parameter values for a given name as array
static java.lang.String getProtocol(java.util.Map objectModel)
          Output the name and version of the protocol the request uses in the form of protocol/majorVersion.minorVersion,
static void getProtocol(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Output the name and version of the protocol the request uses in the form of protocol/majorVersion.minorVersion,
static java.lang.String getQueryString(java.util.Map objectModel)
          Output the query string that is contained in the request URL after the path,
static void getQueryString(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Output the query string that is contained in the request URL after the path,
static java.lang.String getRemoteAddr(java.util.Map objectModel)
          Output the IP address of the client that sent the request
static void getRemoteAddr(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Output the IP address of the client that sent the request
static java.lang.String getRemoteHost(java.util.Map objectModel)
          Output the fully qualified name of the client that sent the request, or the IP address of the client if the name cannot be determined, given Request
static void getRemoteHost(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Output the fully qualified name of the client that sent the request, or the IP address of the client if the name cannot be determined, given Request
static java.lang.String getRemoteUser(java.util.Map objectModel)
          Output the login of the user making the request Could be null if user is not authenticated.
static void getRemoteUser(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Output the login of the user making the request Could be null if user is not authenticated.
static java.lang.String getRequestedURL(java.util.Map objectModel)
           
static void getRequestURI(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler)
          Output the uri associated with the given Request
static java.lang.String getServerName(java.util.Map objectModel)
          Remove the specified attribute
static int getServerPort(java.util.Map objectModel)
          Remove the specified attribute
static void getSessionAttribute(java.util.Map objectModel, org.xml.sax.ContentHandler contentHandler, java.lang.String name, java.lang.Object defaultValue)
          Output the given session attribute value or a user-provided default if none was specified.
static java.lang.Object getSessionAttribute(java.util.Map objectModel, java.lang.String name)
          Return the given session attribute value or a user-provided default if none was specified.
static java.lang.Object getSessionAttribute(java.util.Map objectModel, java.lang.String name, java.lang.Object defaultValue)
          Return the given session attribute value or a user-provided default if none was specified.
static java.util.List getSessionAttributeNames(java.util.Map objectModel)
          Get the session attribute names.
static long getSessionCreationTime(java.util.Map objectModel)
          Get the session creation time
static java.lang.String getSessionId(java.util.Map objectModel)
          Get the session id
static long getSessionLastAccessedTime(java.util.Map objectModel)
          Get the session last accessed time
static long getSessionMaxInactiveInterval(java.util.Map objectModel)
          Get the session max inactive interval
static java.lang.String getSitemapURI(java.util.Map objectModel)
          Outputs the sitemap uri associated with the given objectModel
static void getSitemapURI(java.util.Map objectModel, org.xml.sax.ContentHandler handler)
          Outputs the sitemap uri associated with the given objectModel
static java.lang.String getURI(java.util.Map objectModel)
          Output the uri associated with the given objectModel
static void getURI(java.util.Map objectModel, org.xml.sax.ContentHandler handler)
          Output the uri associated with the given objectModel
static void invalidateSession(java.util.Map objectModel)
          Invalidate the session
static boolean isSecure(java.util.Map objectModel)
          Checks the secure flag
static boolean isSessionNew(java.util.Map objectModel)
          Checks the isNew flag
static void removeAttribute(java.util.Map objectModel, java.lang.String name)
          Remove the specified attribute
static void removeSessionAttribute(java.util.Map objectModel, java.lang.String name)
          Remove the specified attribute
static void setAttribute(java.util.Map objectModel, java.lang.String name, java.lang.Object value)
          Set the specified attribute
static void setSessionAttribute(java.util.Map objectModel, java.lang.String name, java.lang.Object content)
          Sets the given session attribute value
static void setSessionMaxInactiveInterval(java.util.Map objectModel, int interval)
          Set the session max inactive interval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSPRequestHelper

public XSPRequestHelper()
Method Detail

getRequestURI

public static void getRequestURI(java.util.Map objectModel,
                                 org.xml.sax.ContentHandler contentHandler)
                          throws org.xml.sax.SAXException
Output the uri associated with the given Request
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getURI

public static java.lang.String getURI(java.util.Map objectModel)
Output the uri associated with the given objectModel
Parameters:
objectModel - The Map objectModel

getURI

public static void getURI(java.util.Map objectModel,
                          org.xml.sax.ContentHandler handler)
                   throws org.xml.sax.SAXException
Output the uri associated with the given objectModel
Parameters:
objectModel - The Map objectModel

getSitemapURI

public static java.lang.String getSitemapURI(java.util.Map objectModel)
Outputs the sitemap uri associated with the given objectModel
Parameters:
objectModel - the Map objectModel

getSitemapURI

public static void getSitemapURI(java.util.Map objectModel,
                                 org.xml.sax.ContentHandler handler)
                          throws org.xml.sax.SAXException
Outputs the sitemap uri associated with the given objectModel
Parameters:
objectModel - the Map objectModel

getParameter

public static java.lang.String getParameter(java.util.Map objectModel,
                                            java.lang.String name,
                                            java.lang.String defaultValue)
Return the given request parameter value or a user-provided default if none was specified.
Parameters:
objectModel - The Map objectModel
name - The parameter name
defaultValue - Value to substitute in absence of a parameter value

getParameter

public static java.lang.String getParameter(java.util.Map objectModel,
                                            java.lang.String name,
                                            java.lang.String defaultValue,
                                            java.lang.String form_encoding,
                                            java.lang.String container_encoding)
Return the given request parameter value or a user-provided default if none was specified.
Parameters:
objectModel - The Map objectModel
name - The parameter name
defaultValue - Value to substitute in absence of a parameter value
form_encoding - The supposed encoding of the request parameter.
container_encoding - The encoding used by container.

getParameter

public static void getParameter(java.util.Map objectModel,
                                org.xml.sax.ContentHandler contentHandler,
                                java.lang.String name,
                                java.lang.String defaultValue)
                         throws org.xml.sax.SAXException
Output the given request parameter value or a user-provided default if none was specified.
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
name - The parameter name
defaultValue - Value to substitute in absence of a parameter value
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getParameter

public static void getParameter(java.util.Map objectModel,
                                org.xml.sax.ContentHandler contentHandler,
                                java.lang.String name,
                                java.lang.String defaultValue,
                                java.lang.String form_encoding,
                                java.lang.String container_encoding)
                         throws org.xml.sax.SAXException
Output the given request parameter value or a user-provided default if none was specified.
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
name - The parameter name
defaultValue - Value to substitute in absence of a parameter value
form_encoding - The supposed encoding of the request parameter.
container_encoding - The encoding used by container.
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getParameterValues

public static void getParameterValues(java.util.Map objectModel,
                                      org.xml.sax.ContentHandler contentHandler,
                                      java.lang.String name)
                               throws org.xml.sax.SAXException
Output the request parameter values for a given name
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getParameterValues

public static void getParameterValues(java.util.Map objectModel,
                                      org.xml.sax.ContentHandler contentHandler,
                                      java.lang.String name,
                                      java.lang.String form_encoding,
                                      java.lang.String container_encoding)
                               throws org.xml.sax.SAXException
Output the request parameter values for a given name
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
form_encoding - The supposed encoding of the request parameter.
container_encoding - The encoding used by container.
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getParameterValues

public static java.lang.String[] getParameterValues(java.util.Map objectModel,
                                                    java.lang.String name,
                                                    java.lang.String form_encoding,
                                                    java.lang.String container_encoding)
return the request parameter values for a given name as array
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
form_encoding - The supposed encoding of the request parameter.
container_encoding - The encoding used by container.
Returns:
Array containing requested values.

getParameterNames

public static void getParameterNames(java.util.Map objectModel,
                                     org.xml.sax.ContentHandler contentHandler)
                              throws org.xml.sax.SAXException
Output parameter names for a given request
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getHeader

public static java.lang.String getHeader(java.util.Map objectModel,
                                         java.lang.String name)
Return the request header value for a given name
Parameters:
objectModel - The Map objectModel
name - The parameter name

getHeader

public static void getHeader(java.util.Map objectModel,
                             org.xml.sax.ContentHandler contentHandler,
                             java.lang.String name)
                      throws org.xml.sax.SAXException
Output the request header value for a given name
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
name - The parameter name
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getHeaderNames

public static void getHeaderNames(java.util.Map objectModel,
                                  org.xml.sax.ContentHandler contentHandler)
                           throws org.xml.sax.SAXException
Output the header names for a given request
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

setSessionAttribute

public static void setSessionAttribute(java.util.Map objectModel,
                                       java.lang.String name,
                                       java.lang.Object content)
Sets the given session attribute value
Parameters:
objectModel - The Map objectModel
name - The parameter name
content - The parameter value

getSessionAttribute

public static java.lang.Object getSessionAttribute(java.util.Map objectModel,
                                                   java.lang.String name)
Return the given session attribute value or a user-provided default if none was specified.
Parameters:
objectModel - The Map objectModel
name - The parameter name

getSessionAttribute

public static java.lang.Object getSessionAttribute(java.util.Map objectModel,
                                                   java.lang.String name,
                                                   java.lang.Object defaultValue)
Return the given session attribute value or a user-provided default if none was specified.
Parameters:
objectModel - The Map objectModel
name - The parameter name
defaultValue - Value to substitute in absence of a parameter value

removeAttribute

public static void removeAttribute(java.util.Map objectModel,
                                   java.lang.String name)
Remove the specified attribute
Parameters:
objectModel - The Map objectModel
name - The parameter name

getAttribute

public static java.lang.Object getAttribute(java.util.Map objectModel,
                                            java.lang.String name)
Get the specified attribute
Parameters:
objectModel - The Map objectModel
name - The parameter name

getAttributeNames

public static void getAttributeNames(java.util.Map objectModel,
                                     org.xml.sax.ContentHandler contentHandler)
                              throws org.xml.sax.SAXException
Output attribute names for a given request
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

setAttribute

public static void setAttribute(java.util.Map objectModel,
                                java.lang.String name,
                                java.lang.Object value)
Set the specified attribute
Parameters:
objectModel - The Map objectModel
name - The parameter name

getRemoteUser

public static java.lang.String getRemoteUser(java.util.Map objectModel)
Output the login of the user making the request Could be null if user is not authenticated.
Parameters:
objectModel - The Map objectModel

getRemoteUser

public static void getRemoteUser(java.util.Map objectModel,
                                 org.xml.sax.ContentHandler contentHandler)
                          throws org.xml.sax.SAXException
Output the login of the user making the request Could be null if user is not authenticated.
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getMethod

public static java.lang.String getMethod(java.util.Map objectModel)
Output the name of the HTTP method with which the request was made,
Parameters:
objectModel - The Map objectModel

getMethod

public static void getMethod(java.util.Map objectModel,
                             org.xml.sax.ContentHandler contentHandler)
                      throws org.xml.sax.SAXException
Output the name of the HTTP method with which the request was made,
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getQueryString

public static java.lang.String getQueryString(java.util.Map objectModel)
Output the query string that is contained in the request URL after the path,
Parameters:
objectModel - The Map objectModel

getQueryString

public static void getQueryString(java.util.Map objectModel,
                                  org.xml.sax.ContentHandler contentHandler)
                           throws org.xml.sax.SAXException
Output the query string that is contained in the request URL after the path,
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getProtocol

public static java.lang.String getProtocol(java.util.Map objectModel)
Output the name and version of the protocol the request uses in the form of protocol/majorVersion.minorVersion,
Parameters:
objectModel - The Map objectModel

getProtocol

public static void getProtocol(java.util.Map objectModel,
                               org.xml.sax.ContentHandler contentHandler)
                        throws org.xml.sax.SAXException
Output the name and version of the protocol the request uses in the form of protocol/majorVersion.minorVersion,
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getRemoteHost

public static java.lang.String getRemoteHost(java.util.Map objectModel)
Output the fully qualified name of the client that sent the request, or the IP address of the client if the name cannot be determined, given Request
Parameters:
objectModel - The Map objectModel

getRemoteHost

public static void getRemoteHost(java.util.Map objectModel,
                                 org.xml.sax.ContentHandler contentHandler)
                          throws org.xml.sax.SAXException
Output the fully qualified name of the client that sent the request, or the IP address of the client if the name cannot be determined, given Request
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getRemoteAddr

public static java.lang.String getRemoteAddr(java.util.Map objectModel)
Output the IP address of the client that sent the request
Parameters:
objectModel - The Map objectModel

getRemoteAddr

public static void getRemoteAddr(java.util.Map objectModel,
                                 org.xml.sax.ContentHandler contentHandler)
                          throws org.xml.sax.SAXException
Output the IP address of the client that sent the request
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs

isSecure

public static boolean isSecure(java.util.Map objectModel)
Checks the secure flag
Parameters:
objectModel - The Map objectModel

getServerName

public static java.lang.String getServerName(java.util.Map objectModel)
Remove the specified attribute
Parameters:
objectModel - The Map objectModel

getServerPort

public static int getServerPort(java.util.Map objectModel)
Remove the specified attribute
Parameters:
objectModel - The Map objectModel

getRequestedURL

public static java.lang.String getRequestedURL(java.util.Map objectModel)

getSessionAttributeNames

public static java.util.List getSessionAttributeNames(java.util.Map objectModel)
Get the session attribute names.
Parameters:
objectModel - The Map objectModel

getSessionAttribute

public static void getSessionAttribute(java.util.Map objectModel,
                                       org.xml.sax.ContentHandler contentHandler,
                                       java.lang.String name,
                                       java.lang.Object defaultValue)
                                throws org.xml.sax.SAXException
Output the given session attribute value or a user-provided default if none was specified.
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
name - The parameter name
defaultValue - Value to substitute in absence of a parameter value
Throws:
org.xml.sax.SAXException - If a SAX error occurs

getSessionCreationTime

public static long getSessionCreationTime(java.util.Map objectModel)
Get the session creation time
Parameters:
objectModel - The Map objectModel

getSessionId

public static java.lang.String getSessionId(java.util.Map objectModel)
Get the session id
Parameters:
objectModel - The Map objectModel

getSessionLastAccessedTime

public static long getSessionLastAccessedTime(java.util.Map objectModel)
Get the session last accessed time
Parameters:
objectModel - The Map objectModel

getSessionMaxInactiveInterval

public static long getSessionMaxInactiveInterval(java.util.Map objectModel)
Get the session max inactive interval
Parameters:
objectModel - The Map objectModel

setSessionMaxInactiveInterval

public static void setSessionMaxInactiveInterval(java.util.Map objectModel,
                                                 int interval)
Set the session max inactive interval
Parameters:
objectModel - The Map objectModel
interval - max inactive interval

invalidateSession

public static void invalidateSession(java.util.Map objectModel)
Invalidate the session
Parameters:
objectModel - The Map objectModel

isSessionNew

public static boolean isSessionNew(java.util.Map objectModel)
Checks the isNew flag
Parameters:
objectModel - The Map objectModel

removeSessionAttribute

public static void removeSessionAttribute(java.util.Map objectModel,
                                          java.lang.String name)
Remove the specified attribute
Parameters:
objectModel - The Map objectModel
name - The parameter name

getContextPath

public static java.lang.String getContextPath(java.util.Map objectModel)
Obtain the portion of the request URI that indicates the context of the request
Parameters:
objectModel - The Map objectModel

getContextPath

public static void getContextPath(java.util.Map objectModel,
                                  org.xml.sax.ContentHandler contentHandler)
                           throws org.xml.sax.SAXException
Obtain the portion of the request URI that indicates the context of the request
Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
org.xml.sax.SAXException - If a SAX error occurs


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.