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

java.lang.Object
  extended by org.apache.cocoon.components.language.markup.xsp.XSPRequestHelper

public class XSPRequestHelper
extends Object

The Request object helper

Version:
CVS $Id: XSPRequestHelper.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Ricardo Rocha

Constructor Summary
XSPRequestHelper()
           
 
Method Summary
static String[] getAttributeNames(Map objectModel)
          Returns the attribute names
static void getAttributeNames(Map objectModel, ContentHandler contentHandler)
          Output attribute names for a given request
static Date getDateHeader(Map objectModel, String name)
           
static String getDateHeader(Map objectModel, String name, String format)
           
static String[] getHeaderNames(Map objectModel)
          Returns the header names for a given request
static void getHeaderNames(Map objectModel, ContentHandler contentHandler)
          Output the header names for a given request
static String[] getHeaders(Map objectModel, String name)
           
static void getHeaders(Map objectModel, String name, ContentHandler contentHandler)
           
static void getLocale(Map objectModel, ContentHandler handler)
           
static Locale[] getLocales(Map objectModel)
          Return the request locales as array
static void getLocales(Map objectModel, ContentHandler contentHandler)
          Output request locales
static void getParameter(Map objectModel, ContentHandler contentHandler, String name, String defaultValue)
          Output the given request parameter value or a user-provided default if none was specified.
static void getParameter(Map objectModel, ContentHandler contentHandler, String name, String defaultValue, String form_encoding, String container_encoding)
          Output the given request parameter value or a user-provided default if none was specified.
static String getParameter(Map objectModel, String name, String defaultValue)
          Return the given request parameter value or a user-provided default if none was specified.
static String getParameter(Map objectModel, String name, String defaultValue, String form_encoding, String container_encoding)
          Return the given request parameter value or a user-provided default if none was specified.
static String[] getParameterNames(Map objectModel)
          return the request parameter names as array
static void getParameterNames(Map objectModel, ContentHandler contentHandler)
          Output parameter names for a given request
static void getParameterValues(Map objectModel, ContentHandler contentHandler, String name)
          Output the request parameter values for a given name
static void getParameterValues(Map objectModel, ContentHandler contentHandler, String name, String form_encoding, String container_encoding)
          Output the request parameter values for a given name
static String[] getParameterValues(Map objectModel, String name, String form_encoding, String container_encoding)
          return the request parameter values for a given name as array
static String getRequestedURL(Map objectModel)
           
static void getSessionAttribute(Map objectModel, ContentHandler contentHandler, String name, Object defaultValue)
          Output the given session attribute value or a user-provided default if none was specified.
static Object getSessionAttribute(Map objectModel, String name, Object defaultValue)
          Return the given session attribute value or a user-provided default if none was specified.
 
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

getLocale

public static void getLocale(Map objectModel,
                             ContentHandler handler)
                      throws SAXException
Throws:
SAXException

getLocales

public static Locale[] getLocales(Map objectModel)
Return the request locales as array

Returns:
Array containing request locales.

getLocales

public static void getLocales(Map objectModel,
                              ContentHandler contentHandler)
                       throws SAXException
Output request locales

Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
SAXException - If a SAX error occurs

getParameter

public static String getParameter(Map objectModel,
                                  String name,
                                  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 String getParameter(Map objectModel,
                                  String name,
                                  String defaultValue,
                                  String form_encoding,
                                  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(Map objectModel,
                                ContentHandler contentHandler,
                                String name,
                                String defaultValue)
                         throws 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:
SAXException - If a SAX error occurs

getParameter

public static void getParameter(Map objectModel,
                                ContentHandler contentHandler,
                                String name,
                                String defaultValue,
                                String form_encoding,
                                String container_encoding)
                         throws 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:
SAXException - If a SAX error occurs

getParameterValues

public static void getParameterValues(Map objectModel,
                                      ContentHandler contentHandler,
                                      String name)
                               throws SAXException
Output the request parameter values for a given name

Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
SAXException - If a SAX error occurs

getParameterValues

public static void getParameterValues(Map objectModel,
                                      ContentHandler contentHandler,
                                      String name,
                                      String form_encoding,
                                      String container_encoding)
                               throws 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:
SAXException - If a SAX error occurs

getParameterValues

public static String[] getParameterValues(Map objectModel,
                                          String name,
                                          String form_encoding,
                                          String container_encoding)
return the request parameter values for a given name as array

Parameters:
objectModel - The Map objectModel
form_encoding - The supposed encoding of the request parameter.
container_encoding - The encoding used by container.
Returns:
Array containing requested values.

getParameterNames

public static String[] getParameterNames(Map objectModel)
return the request parameter names as array

Returns:
Array containing parameter names.

getParameterNames

public static void getParameterNames(Map objectModel,
                                     ContentHandler contentHandler)
                              throws SAXException
Output parameter names for a given request

Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
SAXException - If a SAX error occurs

getHeaderNames

public static void getHeaderNames(Map objectModel,
                                  ContentHandler contentHandler)
                           throws SAXException
Output the header names for a given request

Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
SAXException - If a SAX error occurs

getHeaderNames

public static String[] getHeaderNames(Map objectModel)
Returns the header names for a given request

Parameters:
objectModel - The Map objectModel

getHeaders

public static String[] getHeaders(Map objectModel,
                                  String name)

getHeaders

public static void getHeaders(Map objectModel,
                              String name,
                              ContentHandler contentHandler)
                       throws SAXException
Throws:
SAXException

getDateHeader

public static Date getDateHeader(Map objectModel,
                                 String name)

getDateHeader

public static String getDateHeader(Map objectModel,
                                   String name,
                                   String format)

getAttributeNames

public static void getAttributeNames(Map objectModel,
                                     ContentHandler contentHandler)
                              throws SAXException
Output attribute names for a given request

Parameters:
objectModel - The Map objectModel
contentHandler - The SAX content handler
Throws:
SAXException - If a SAX error occurs

getAttributeNames

public static String[] getAttributeNames(Map objectModel)
Returns the attribute names

Parameters:
objectModel - The Map objectModel

getRequestedURL

public static String getRequestedURL(Map objectModel)

getSessionAttribute

public static Object getSessionAttribute(Map objectModel,
                                         String name,
                                         Object defaultValue)
Return the given session attribute value or a user-provided default if none was specified.

Parameters:
objectModel - The Map objectModel
name - The attribute name
defaultValue - Value to substitute in absence of a attribute value

getSessionAttribute

public static void getSessionAttribute(Map objectModel,
                                       ContentHandler contentHandler,
                                       String name,
                                       Object defaultValue)
                                throws 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 attribute name
defaultValue - Value to substitute in absence of an attribute value
Throws:
SAXException - If a SAX error occurs


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.