Class ServletUtil

  extended by org.apache.cactus.internal.server.ServletUtil

public class ServletUtil
extends java.lang.Object

All prupose utility methods for manipulating the Servlet API.

$Id: 238991 2004-05-22 11:34:50Z vmassol $

Constructor Summary
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


public ServletUtil()
Method Detail


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.

theQueryString - the query string to parse
theParameter - the name of the parameter to locate
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.