org.apache.cactus.server
Class ServletUtil

java.lang.Object
  extended byorg.apache.cactus.server.ServletUtil

public class ServletUtil
extends java.lang.Object

All prupose utility methods for manipulating the Servlet API.

Version:
$Id: ServletUtil.java,v 1.5 2003/05/26 11:45:22 cmlenz Exp $
Author:
Vincent Massol

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 © 2000-2003 Apache Software Foundation. All Rights Reserved.