1 16 17 package org.apache.taglibs.datetime; 18 19 import java.util.*; 20 import java.text.*; 21 import javax.servlet.*; 22 import javax.servlet.http.*; 23 import javax.servlet.jsp.*; 24 import javax.servlet.jsp.tagext.*; 25 26 48 49 public class TimeZoneTag extends BodyTagSupport 50 { 51 52 57 public final int doStartTag() throws JspException 58 { 59 return EVAL_BODY_TAG; 60 } 61 62 67 public final int doAfterBody() throws JspException 68 { 69 BodyContent body = getBodyContent(); 71 String s = body.getString().trim(); 72 body.clearBody(); 74 75 TimeZone tz = TimeZone.getTimeZone(s); 76 if( tz == null ) 77 tz = TimeZone.getDefault(); 78 79 pageContext.setAttribute(id,tz,PageContext.SESSION_SCOPE); 80 return SKIP_BODY; 81 } 82 83 88 public final int doEndTag() throws JspException 89 { 90 return EVAL_PAGE; 91 } 92 93 } 94 | Popular Tags |