com.ibm.wbi.http.beans
Class FormHelper

java.lang.Object
  |
  +--com.ibm.wbi.http.beans.FormHelper

public class FormHelper
extends java.lang.Object

Helper class to access the form data of an HTTP request. Form data is one or more key-value-pairs contained in the URL of an HTTP request. Example:

    http://www.ibm.com/search?key1=value1&key2=value2
 
The pairs key1/value1 and key2/value2 represent the form data.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright information
 
Constructor Summary
FormHelper()
           
 
Method Summary
static java.lang.String decodeString(java.lang.String coded)
          Decodes a given String of form data.
static java.util.Properties interpretFormData(MegInputStream in, DocumentInfo di)
          Access the form data of an HTTP request through the request event's InputStream and Document information objects.
static java.util.Properties interpretFormData(RequestEvent e)
          Interpret the form data of an HTTP request.
static java.util.Properties interpretFormData(java.lang.String formData)
          Interpret the content of a string as form data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM copyright information
Constructor Detail

FormHelper

public FormHelper()
Method Detail

interpretFormData

public static java.util.Properties interpretFormData(RequestEvent e)
Interpret the form data of an HTTP request.
Parameters:
e - Request event object.
Returns:
The form data as key-value-pairs in java.util.Properties object.

interpretFormData

public static java.util.Properties interpretFormData(MegInputStream in,
                                                     DocumentInfo di)
Access the form data of an HTTP request through the request event's InputStream and Document information objects.
Parameters:
in - Inputstream of the current request event.
di - Document information object.
Returns:
The form data as key-value-pairs in java.util.Properties object.

interpretFormData

public static java.util.Properties interpretFormData(java.lang.String formData)
Interpret the content of a string as form data.
Parameters:
formData - String holding the form data.
Returns:
The form data as key-value-pairs in java.util.Properties object.

decodeString

public static java.lang.String decodeString(java.lang.String coded)
Decodes a given String of form data. Certain characters are encoded such that strings can be used in the form data of an HTTP request. This method reverses this process.
Parameters:
coded - Part of the form data.
Returns:
Decoded part of the form data.