org.apache.turbine.util
Class ServletUtils

java.lang.Object
  extended byorg.apache.turbine.util.ServletUtils

public class ServletUtils
extends java.lang.Object

This is where common Servlet manipulation routines should go.

Version:
$Id: ServletUtils.java 534527 2007-05-02 16:10:59Z tv $
Author:
Gonzalo Diethelm, Henning P. Schmiedehausen

Field Summary
static int FTP_PORT
          Deprecated. use URIConstants.FTP_PORT
static int HTTP_PORT
          Deprecated. use URIConstants.HTTP_PORT
static int HTTPS_PORT
          Deprecated. use URIConstants.HTTPS_PORT
static java.lang.String URI_SCHEME_SEPARATOR
          Deprecated. use URIConstants.URI_SCHEME_SEPARATOR;
 
Constructor Summary
ServletUtils()
           
 
Method Summary
static java.lang.String expandRelative(javax.servlet.ServletConfig config, java.lang.String text)
          Expands a string that points to a relative path or path list, leaving it as an absolute path based on the servlet context.
static java.lang.StringBuffer hostURL(javax.servlet.http.HttpServletRequest req)
          Deprecated. Use ServerData(req).getHostUrl()
static java.lang.StringBuffer hostURL(javax.servlet.http.HttpServletRequest req, java.lang.String scheme)
          Deprecated. Use ServerData(req).getHostUrl()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_PORT

public static final int HTTP_PORT
Deprecated. use URIConstants.HTTP_PORT

The default HTTP port number.

See Also:
Constant Field Values

HTTPS_PORT

public static final int HTTPS_PORT
Deprecated. use URIConstants.HTTPS_PORT

The default HTTPS port number.

See Also:
Constant Field Values

FTP_PORT

public static final int FTP_PORT
Deprecated. use URIConstants.FTP_PORT

The default FTP port number.

See Also:
Constant Field Values

URI_SCHEME_SEPARATOR

public static final java.lang.String URI_SCHEME_SEPARATOR
Deprecated. use URIConstants.URI_SCHEME_SEPARATOR;

The part of the URI which separates the protocol indicator (i.e. the scheme) from the rest of the URI.

See Also:
Constant Field Values
Constructor Detail

ServletUtils

public ServletUtils()
Method Detail

expandRelative

public static java.lang.String expandRelative(javax.servlet.ServletConfig config,
                                              java.lang.String text)
Expands a string that points to a relative path or path list, leaving it as an absolute path based on the servlet context. It will return null if the text is empty or the config object is null.

Parameters:
config - The ServletConfig.
text - The String containing a path or path list.
Returns:
A String with the expanded path or path list.

hostURL

public static java.lang.StringBuffer hostURL(javax.servlet.http.HttpServletRequest req)
Deprecated. Use ServerData(req).getHostUrl()

Defaults to the scheme used in the supplied request.

See Also:
hostURL(HttpServletRequest req, String proto)

hostURL

public static java.lang.StringBuffer hostURL(javax.servlet.http.HttpServletRequest req,
                                             java.lang.String scheme)
Deprecated. Use ServerData(req).getHostUrl()

Returns a URL fragment derived from the provided HTTP request, including the protocol used to address the server (if non-standard for HTTP/HTTPS). Returns the fragment as a buffer

Parameters:
req - The request to extract information from.
scheme - The protocol indicator to prefix the host name with, or the protocol used to address the server with if null.
Returns:
The desired URL fragment.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.