|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts.util.ResponseUtils
public class ResponseUtils
General purpose utility methods related to generating a servlet response in the Struts controller framework.
Field Summary | |
---|---|
private static java.lang.reflect.Method |
encode
Java 1.4 encode method to use instead of deprecated 1.3 version. |
private static org.apache.commons.logging.Log |
log
Commons logging instance. |
protected static MessageResources |
messages
The message resources for this package. |
Constructor Summary | |
---|---|
ResponseUtils()
|
Method Summary | |
---|---|
static java.lang.String |
encodeURL(java.lang.String url)
URLencodes a string assuming the character encoding is UTF-8. |
static java.lang.String |
encodeURL(java.lang.String url,
java.lang.String enc)
Use the new URLEncoder.encode() method from Java 1.4 if available, else use the old deprecated version. |
static java.lang.String |
filter(java.lang.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 java.lang.String |
filterIfQuote(java.lang.String value)
Replace double-quote characters in the input string with proper HTML encoding. |
static void |
write(javax.servlet.jsp.PageContext pageContext,
java.lang.String text)
Deprecated. use TagUtils.write() method instead. This method will be removed after Struts 1.2. |
static void |
writePrevious(javax.servlet.jsp.PageContext pageContext,
java.lang.String text)
Deprecated. use TagUtils.writePrevious() method instead. This method will be removed after Struts 1.2. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static MessageResources messages
private static java.lang.reflect.Method encode
private static final org.apache.commons.logging.Log log
Constructor Detail |
---|
public ResponseUtils()
Method Detail |
---|
public static java.lang.String filter(java.lang.String value)
value
- The string to be filtered and returnedpublic static java.lang.String filterIfQuote(java.lang.String value)
"
).
Note that you should not use this function in new code. It is only intended for old code which needs to be backwards-compatible with incompletely-quoted attributes.
public static java.lang.String encodeURL(java.lang.String url)
URLencodes a string assuming the character encoding is UTF-8.
url
-
public static java.lang.String encodeURL(java.lang.String url, java.lang.String enc)
enc
- The character encoding the urlencode is performed on.
public static void write(javax.servlet.jsp.PageContext pageContext, java.lang.String text) throws javax.servlet.jsp.JspException
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
javax.servlet.jsp.JspException
- if an input/output error occurs (already saved)public static void writePrevious(javax.servlet.jsp.PageContext pageContext, java.lang.String text) throws javax.servlet.jsp.JspException
pageContext
- The PageContext object for this pagetext
- The text to be written
javax.servlet.jsp.JspException
- if an input/output error occurs (already saved)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |