org.objectledge.parameters
Class RequestParameters

java.lang.Object
  extended by org.objectledge.parameters.DefaultParameters
      extended by org.objectledge.parameters.SortedParameters
          extended by org.objectledge.parameters.RequestParameters
All Implemented Interfaces:
Parameters

public class RequestParameters
extends SortedParameters

Request parameters contain parameters from the request sorted by their names.

TODO: figure out a way to discover URL parameters encoding, now UTF-8 is used, but browsers encode GET form parameters using form page encoding thus rendering UTF-8 decoding useless. Problems:

Version:
$Id: RequestParameters.java,v 1.17 2005/08/05 12:48:27 rafal Exp $
Author:
Damian Gajda, Pawel Potempski

Field Summary
private static int NAME
           
private  Set<String> pathParams
           
private  Set<String> postParams
           
private  Set<String> queryParams
           
private static int SEPARATOR_AFTER_NAME
           
private static int SEPARATOR_AFTER_VALUE
           
private static int START
           
private static int VALUE
           
 
Fields inherited from class org.objectledge.parameters.DefaultParameters
map, TRUE
 
Constructor Summary
protected RequestParameters()
          No arg constructor for mocking.
  RequestParameters(javax.servlet.http.HttpServletRequest request)
          Create the parameter container with parameters found in http request.
 
Method Summary
 void addPOSTParameter(String name, String value)
          To be used by FileUploadValve, that handles multipart/form-data POSTs.
private  void addURLParams(String urlPart, String separator)
           
static RequestParameters getRequestParameters(Context context)
          Usefull method to retrieve parameters from context.
 boolean isPathInfoParameter(String name)
          Checks if the parameter was passed in through request path info.
 boolean isPOSTParameter(String name)
          Checks if the parameter was passed in through POST request body.
 boolean isQueryStringParameter(String name)
          Checks if the parameter was passed in through request query string.
 
Methods inherited from class org.objectledge.parameters.SortedParameters
setupMap
 
Methods inherited from class org.objectledge.parameters.DefaultParameters
add, add, add, add, add, add, add, add, add, add, add, add, add, get, get, getBoolean, getBoolean, getBooleans, getChild, getDate, getDate, getDates, getFloat, getFloat, getFloats, getInt, getInt, getInts, getLong, getLong, getLongs, getParameterNames, getSingleValue, getStrings, isDefined, remove, remove, remove, remove, remove, remove, remove, remove, removeExcept, set, set, set, set, set, set, set, set, set, set, set, set, set, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pathParams

private Set<String> pathParams

queryParams

private Set<String> queryParams

postParams

private Set<String> postParams

START

private static final int START
See Also:
Constant Field Values

NAME

private static final int NAME
See Also:
Constant Field Values

SEPARATOR_AFTER_NAME

private static final int SEPARATOR_AFTER_NAME
See Also:
Constant Field Values

VALUE

private static final int VALUE
See Also:
Constant Field Values

SEPARATOR_AFTER_VALUE

private static final int SEPARATOR_AFTER_VALUE
See Also:
Constant Field Values
Constructor Detail

RequestParameters

protected RequestParameters()
No arg constructor for mocking.


RequestParameters

public RequestParameters(javax.servlet.http.HttpServletRequest request)
                  throws IllegalArgumentException
Create the parameter container with parameters found in http request.

Parameters:
request - the request
Throws:
IllegalArgumentException - if illegal escape sequences appears.
Method Detail

getRequestParameters

public static RequestParameters getRequestParameters(Context context)
Usefull method to retrieve parameters from context.

Parameters:
context - the context.
Returns:
the request parameters.

addURLParams

private void addURLParams(String urlPart,
                          String separator)

isPathInfoParameter

public boolean isPathInfoParameter(String name)
Checks if the parameter was passed in through request path info.

Parameters:
name - name of the parameter.
Returns:
true if the parameter was passed in through path info.

isQueryStringParameter

public boolean isQueryStringParameter(String name)
Checks if the parameter was passed in through request query string.

Parameters:
name - name of the parameter.
Returns:
true if the parameter was passed in through request query string.

isPOSTParameter

public boolean isPOSTParameter(String name)
Checks if the parameter was passed in through POST request body.

Parameters:
name - name of the parameter.
Returns:
true if the parameter was passed through POST request body.

addPOSTParameter

public void addPOSTParameter(String name,
                             String value)
To be used by FileUploadValve, that handles multipart/form-data POSTs.

Parameters:
name - of the parameter.
value - value of the parameter.


Copyright © 2003-2006 objectledge.org. All Rights Reserved.