org.apache.struts.util
Class ResponseUtils
java.lang.Object
org.apache.struts.util.ResponseUtils
public class ResponseUtils
extends java.lang.Object
General purpose utility methods related to generating a servlet response
in the Struts controller framework.
$Rev: 164747 $ $Date: 2005-04-26 06:47:48 +0100 (Tue, 26 Apr 2005) $private static Method | encode - Java 1.4 encode method to use instead of deprecated 1.3 version.
|
private static Log | log - Commons logging instance.
|
protected static MessageResources | messages - The message resources for this package.
|
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 sensitive to
HTML interpreters, returning the string with these characters replaced
by the corresponding character entities.
|
static void | write(PageContext pageContext, String text) - use TagUtils.write() method instead.
|
static void | writePrevious(PageContext pageContext, String text) - use TagUtils.writePrevious() method instead.
|
encode
private static Method encode
Java 1.4 encode method to use instead of deprecated 1.3 version.
log
private static final Log log
Commons logging instance.
messages
protected static MessageResources messages
The message resources for this package.
encodeURL
public static String encodeURL(String url)
URLencodes a string assuming the character encoding is UTF-8.
- 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.
enc
- The character encoding the urlencode is performed on.
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.
value
- The string to be filtered and returned
write
public static void write(PageContext pageContext,
String text)
throws JspException
use TagUtils.write() method instead.
This method will be removed after Struts 1.2.
Write the specified text as the response to the writer associated with
this page. WARNING - If you are writing body content
from the doAfterBody()
method of a custom tag class that
implements BodyTag
, you should be calling
writePrevious()
instead.
pageContext
- The PageContext object for this pagetext
- The text to be written
writePrevious
public static void writePrevious(PageContext pageContext,
String text)
throws JspException
use TagUtils.writePrevious() method instead.
This method will be removed after Struts 1.2.
Write the specified text as the response to the writer associated with
the body content for the tag within which we are currently nested.
pageContext
- The PageContext object for this pagetext
- The text to be written
Copyright B) 2000-2007 - The Apache Software Foundation