Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts.util
Class ResponseUtils

    java.lang.Object
      org.apache.struts.util.ResponseUtils

    public class ResponseUtils

extends Object

General purpose utility methods related to generating a servlet response in the Struts controller framework.

Version:
  $Rev: 471754 $ $Date: 2005-08-21 14:46:28 -0400 (Sun, 21 Aug 2005) $

Field Summary
`protected static MessageResources` | `messages` The message resources for this package.

Constructor Summary
`ResponseUtils()`

Method Summary
`static String` | `encodeURL(String url)` URLencodes a string assuming the character encoding is UTF-8.
`static String` | `encodeURL(String url, String enc)` Use the new URLEncoder.encode() method from Java 1.4 if available, else use the old deprecated version.
`static String` | `filter(String value)` Filter the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### messages

    protected static MessageResources messages

  The message resources for this package.

Constructor Detail

### ResponseUtils

    public ResponseUtils()

Method Detail

### filter

    public static String filter(String value)

  Filter the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities.

  Parameters:
    `value` - The string to be filtered and returned

### encodeURL

    public static String encodeURL(String url)

  URLencodes a string assuming the character encoding is UTF-8.

  Parameters:
    `url` -
  Returns:
    String The encoded url in UTF-8

### encodeURL

    public static String encodeURL(String url,
                                   String enc)

  Use the new URLEncoder.encode() method from Java 1.4 if available, else use the old deprecated version. This method uses reflection to find the appropriate method; if the reflection operations throw exceptions, this will return the url encoded with the old URLEncoder.encode() method.

  Parameters:
    `enc` - The character encoding the urlencode is performed on.
  Returns:
    String The encoded url.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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