org.opensubsystems.core.www
Class TagUtils

java.lang.Object
  extended by org.opensubsystems.core.www.TagUtils

public final class TagUtils
extends java.lang.Object

This class is a collection of useful methods when working with custom JSP tags. Many methods in this class are inspired by Struts classes org.apache.struts.util.ResponseUtils org.apache.struts.taglib.TagUtils

Version:
$Id: TagUtils.java,v 1.5 2007/01/07 06:14:09 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Method Summary
static java.lang.String filter(java.lang.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(javax.servlet.jsp.PageContext pageContext, java.lang.String text)
          Write the specified text as the response to the writer associated with this page.
static void writePrevious(javax.servlet.jsp.PageContext pageContext, java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

filter

public static java.lang.String filter(java.lang.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
Returns:
String - filtered value

write

public static void write(javax.servlet.jsp.PageContext pageContext,
                         java.lang.String text)
                  throws javax.servlet.jsp.JspException
Write the specified text as the response to the writer associated with this page. Note: 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
Throws:
javax.servlet.jsp.JspException - - an error has occured

writePrevious

public static void writePrevious(javax.servlet.jsp.PageContext pageContext,
                                 java.lang.String text)
                          throws javax.servlet.jsp.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
Throws:
javax.servlet.jsp.JspException - - an error has occured


Copyright © 2003 - 2006 OpenSubsystems s.r.o.