org.apache.struts.util

Class ResponseUtils


public class ResponseUtils
extends java.lang.Object

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

Version:
$Revision: 1.6 $ $Date: 2002/12/08 07:12:17 $

Author:
Craig R. McClanahan

Field Summary

protected static MessageResources
messages
The message resources for this package.

Method Summary

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.
static void
write(PageContext pageContext, String text)
Write the specified text as the response to the writer associated with this page.
static void
writePrevious(PageContext pageContext, String text)
Write the specified text as the response to the writer associated with the body content for the tag within which we are currently nested.

Field Details

messages

protected static MessageResources messages
The message resources for this package.

Method Details

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


write

public static void write(PageContext pageContext,
                         String text)
            throws JspException
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.

Parameters:
pageContext - The PageContext object for this page
text - The text to be written


writePrevious

public static void writePrevious(PageContext pageContext,
                                 String text)
            throws JspException
Write the specified text as the response to the writer associated with the body content for the tag within which we are currently nested.

Parameters:
pageContext - The PageContext object for this page
text - The text to be written


Copyright B) 2000-2005 - Apache Software Foundation