net.mlw.vlh.web.util
Class JspUtils

java.lang.Object
  extended bynet.mlw.vlh.web.util.JspUtils

public final class JspUtils
extends Object

A lot of this functionality is in the Struts ResponceUtils, but I do not want to create a dependicy to struts.

Version:
$Revision: 1.7 $ $Date: 2005/11/23 14:32:58 $
Author:
Matthew L. Wilson, Andrej Zachar

Method Summary
static String format(Object value, String format, Locale loc)
           
static javax.servlet.jsp.tagext.Tag getParent(javax.servlet.jsp.tagext.Tag self, Class klass)
           
static String toAttributesString(Map map)
           
static Collection toCollection(String value, String token)
          Converts a stirng into a collection of strings.
static void write(javax.servlet.jsp.PageContext pageContext, String text)
          Write the specified text as the response to the writer associated with this page.
static void writePrevious(javax.servlet.jsp.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

write

public static void write(javax.servlet.jsp.PageContext pageContext,
                         String text)
                  throws javax.servlet.jsp.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
Throws:
javax.servlet.jsp.JspException - if an input/output error occurs

writePrevious

public static void writePrevious(javax.servlet.jsp.PageContext pageContext,
                                 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 - if an input/output error occurs

toCollection

public static Collection toCollection(String value,
                                      String token)
Converts a stirng into a collection of strings.

Parameters:
value - The string to be parsed.
token - The token to be used.
Returns:
A Collection of String(s).

format

public static String format(Object value,
                            String format,
                            Locale loc)

toAttributesString

public static String toAttributesString(Map map)

getParent

public static javax.servlet.jsp.tagext.Tag getParent(javax.servlet.jsp.tagext.Tag self,
                                                     Class klass)
                                              throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException


Copyright © 2003-2006 mlavilson. All Rights Reserved.