org.apache.beehive.netui.util
Class ServletUtils

Object
  extended by ServletUtils

public class ServletUtils
extends Object


Constructor Summary
ServletUtils()
           
 
Method Summary
static void dumpRequest(ServletRequest request, PrintStream output)
          Print parameters and attributes in the given request.
static void dumpServletContext(ServletContext context, PrintStream output)
          Print attributes in the given ServletContext.
static String getBaseName(String uri)
          Get the base filename of the given URI.
static String getDirName(String uri)
          Get the directory path of the given URI.
static void preventCache(ServletResponse response)
          Set response headers to prevent caching of the response by the browser.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletUtils

public ServletUtils()
Method Detail

dumpRequest

public static void dumpRequest(ServletRequest request,
                               PrintStream output)
Print parameters and attributes in the given request.

Parameters:
request - the current HttpServletRequest.
output - a PrintStream to which to output request parameters and request/session attributes; if null, System.err is used.

dumpServletContext

public static void dumpServletContext(ServletContext context,
                                      PrintStream output)
Print attributes in the given ServletContext.

Parameters:
context - the current ServletContext.
output - a PrintStream to which to output ServletContext attributes; if null, System.err is used.

preventCache

public static void preventCache(ServletResponse response)
Set response headers to prevent caching of the response by the browser.

Parameters:
response - the current ServletResponse

getBaseName

public static String getBaseName(String uri)
Get the base filename of the given URI.

Parameters:
uri - the URI from which to get the base filename.
Returns:
a String containing everything after the last slash of the given URI.

getDirName

public static String getDirName(String uri)
Get the directory path of the given URI.

Parameters:
uri - the URI from which to get the directory path.
Returns:
a String containing everything before the last slash of the given URI.