public class

HttpRequestKeys

extends GenericRequestKeys
java.lang.Object
   ↳ com.microstrategy.web.beans.GenericRequestKeys
     ↳ com.microstrategy.web.app.beans.HttpRequestKeys

Class Overview

The HttpRequestKeys class makes available to the application the values of parameters passed on the URL (Query String), post (form data), cookies and session variables.
It has been implemented as case insensitive, meaning that if one key is recorded as "abc" with value "1" and another with key as "ABC" and value "2", both values will be accessible via the same key (that can be requested as "abc", "ABC", "aBC", etc)

Summary

Constants
int COOKIE_SPACE Flag for including cookies on the key space property of the HttpRequestKeys instance
int FORM_AND_QUERY_DATA_SPACE Flag for including form data on the key space property of the HttpRequestKeys instance
int SESSION_SPACE Flag for including session variables on the key space property of the HttpRequestKeys instance
Public Constructors
HttpRequestKeys(ContainerServices containerServices)
Class constructor.
Public Methods
String add(String key, String value)
Add the requested key and its value to the collection.
Enumeration getKeyListByPrefix(String prefix)
Returns an enumeration over all the keys with the specified prefix.
int getKeySpace()
Get the key space set for this HttpRequestKeys instance.
String getValue(String keyName)
Returns from this collection a comma separated string of all the values mapped by the specified keyName.
String getValue(String keyName, int valueIndex)
Returns the value at the specified position mapped by the specified keyName.
int getValueCount(String keyName)
Returns from this collection the number of values mapped with the keyName.
void setKeySpace(int keySpace)
Set the key space to be used with this HttpRequestKeys instance.
Protected Methods
void initializeRequestKeys()
Initializes the collection with the values from the Request and/or Session, according to what was specified by the keySpace.
[Expand]
Inherited Methods
From class com.microstrategy.web.beans.GenericRequestKeys
From class java.lang.Object
From interface com.microstrategy.web.beans.RequestKeys

Constants

public static final int COOKIE_SPACE

Flag for including cookies on the key space property of the HttpRequestKeys instance

Constant Value: 1 (0x00000001)

public static final int FORM_AND_QUERY_DATA_SPACE

Flag for including form data on the key space property of the HttpRequestKeys instance

Constant Value: 2 (0x00000002)

public static final int SESSION_SPACE

Flag for including session variables on the key space property of the HttpRequestKeys instance

Constant Value: 4 (0x00000004)

Public Constructors

public HttpRequestKeys (ContainerServices containerServices)

Class constructor. Initialization requires a non-null Container Services object.

Parameters
containerServices an initialized instance of ContainerServices

Public Methods

public String add (String key, String value)

Add the requested key and its value to the collection. Before adding manually new key values, this RequestKeys instance should have initialized the session and request properties, so all the values are added correctly.

Parameters
key the key under which the new value will be appended
value the value to be appended
Returns
  • a copy of the value added

public Enumeration getKeyListByPrefix (String prefix)

Returns an enumeration over all the keys with the specified prefix.
Returns all the keys if the specified prefix is null or empty.
Returns an empty list if no key is found.

Parameters
prefix the prefix of keys.
Returns
  • an enumeration over all the keys that have the specified prefix.

public int getKeySpace ()

Get the key space set for this HttpRequestKeys instance.

Returns
  • an int value representing the flags from where the information for the HttpRequestKeys is going to be taken from.

public String getValue (String keyName)

Returns from this collection a comma separated string of all the values mapped by the specified keyName.

Parameters
keyName a key in this collection
Returns
  • all the values mapped to the keyName, separated by the character comma; null if the key does not exist.

public String getValue (String keyName, int valueIndex)

Returns the value at the specified position mapped by the specified keyName.

Parameters
keyName a key in this collection
valueIndex the index of a value mapped to the key specified
Returns
  • the value at the specified position mapped by the specified key; null if the key does not exist.

public int getValueCount (String keyName)

Returns from this collection the number of values mapped with the keyName.

Parameters
keyName a key to a value collection
Returns
  • the count of values to which the specified key is mapped in this collection; 0 if the key is not found.

public void setKeySpace (int keySpace)

Set the key space to be used with this HttpRequestKeys instance.

Parameters
keySpace an int value representing the flags from where the information for the HttpRequestKeys is going to be taken from.

Protected Methods

protected void initializeRequestKeys ()

Initializes the collection with the values from the Request and/or Session, according to what was specified by the keySpace.