FileDocCategorySizeDatePackage
TimeZoneSupport.javaAPI DocGlassfish v2 API5541Sat May 05 19:17:54 BST 2007org.apache.taglibs.standard.tag.common.fmt

TimeZoneSupport

public abstract class TimeZoneSupport extends javax.servlet.jsp.tagext.BodyTagSupport
Support for tag handlers for <timeZone>, the time zone tag in JSTL 1.0.
author
Jan Luehe

Fields Summary
protected Object
value
private TimeZone
timeZone
Constructors Summary
public TimeZoneSupport()

	super();
	init();
    
Methods Summary
public intdoEndTag()

	try {
	    pageContext.getOut().print(bodyContent.getString());
	} catch (IOException ioe) {
	    throw new JspTagException(ioe.toString(), ioe);
	}

	return EVAL_PAGE;
    
public intdoStartTag()


	if (value == null) {
	    timeZone = TimeZone.getTimeZone("GMT");
	} else if (value instanceof String) {
	    if (((String) value).trim().equals("")) {
		timeZone = TimeZone.getTimeZone("GMT");
	    } else {
		timeZone = TimeZone.getTimeZone((String) value);
	    }
	} else {
	    timeZone = (TimeZone) value;
	}

	return EVAL_BODY_BUFFERED;
    
public java.util.TimeZonegetTimeZone()

	return timeZone;
    
static java.util.TimeZonegetTimeZone(javax.servlet.jsp.PageContext pc, javax.servlet.jsp.tagext.Tag fromTag)

	TimeZone tz = null;

	Tag t = findAncestorWithClass(fromTag, TimeZoneSupport.class);
	if (t != null) {
	    // use time zone from parent <timeZone> tag
	    TimeZoneSupport parent = (TimeZoneSupport) t;
	    tz = parent.getTimeZone();
	} else {
	    // get time zone from configuration setting
	    Object obj = Config.find(pc, Config.FMT_TIME_ZONE);
	    if (obj != null) {
		if (obj instanceof TimeZone) {
		    tz = (TimeZone) obj;
		} else {
		    tz = TimeZone.getTimeZone((String) obj);
		}
	    }
	}

	return tz;
    
private voidinit()

	value = null;
    
public voidrelease()

	init();