org.apache.cactus.internal.server
Class ServletUtil

java.lang.Object
  extended by org.apache.cactus.internal.server.ServletUtil

public class ServletUtil
extends java.lang.Object

All prupose utility methods for manipulating the Servlet API.

Version:
$Id: ServletUtil.java 238991 2004-05-22 11:34:50Z vmassol $

Constructor Summary
ServletUtil()
           
 
Method Summary
static java.lang.String getQueryStringParameter(java.lang.String theQueryString, java.lang.String theParameter)
          A substitute method for HttpServletRequest.getParameter().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletUtil

public ServletUtil()
Method Detail

getQueryStringParameter

public static java.lang.String getQueryStringParameter(java.lang.String theQueryString,
                                                       java.lang.String theParameter)
A substitute method for HttpServletRequest.getParameter(). Contrary to getParameter(), this method does not access the request input stream (only the query string of the url). Note: We use this method internally to retrieve Cactus parameters passed by the client side. The issue with getParameter() is that if you use it, then you cannot call getReader() or getInputStream() (see the Servlet spec). However, if we want to allow for testing code that uses these 2 methods (and we do !) we need to use this method to get the internal Cactus parameters.

Parameters:
theQueryString - the query string to parse
theParameter - the name of the parameter to locate
Returns:
the value for theParameter in theQueryString, null if theParameter does not exist and "" if the parameter exists but has no value defined in the query string


Copyright © 2001-2009 The Apache Software Foundation. All Rights Reserved.