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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static MessageResources
    The message resources for this package.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Class is not instanceable.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    URLencodes a string assuming the character encoding is UTF-8.
    static String
    encodeURL(String url, String enc)
    Use the URLEncoder.encode() with the given encoding.
    static String
    filter(String value)
    Filter the specified string for characters that are sensitive 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 Details

    • messages

      protected static MessageResources messages
      The message resources for this package.
  • Constructor Details

    • ResponseUtils

      protected ResponseUtils()
      Class is not instanceable.
  • Method Details

    • filter

      public static String filter(String value)
      Filter the specified string for characters that are sensitive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities.
      Parameters:
      value - The string to be filtered and returned
      Returns:
      String The filtered string
    • encodeURL

      public static String encodeURL(String url)
      URLencodes a string assuming the character encoding is UTF-8.
      Parameters:
      url - The url to encode
      Returns:
      String The encoded url in UTF-8
    • encodeURL

      public static String encodeURL(String url, String enc)
      Use the URLEncoder.encode() with the given encoding. When the encoding charset didn't found, then it will be tried with the default-charset.
      Parameters:
      url - The url to encode
      enc - The character encoding the urlencode is performed on.
      Returns:
      String The encoded url.