jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt BundleSupport.java TimeZoneSupport.java
Date Thu, 06 Dec 2001 20:19:50 GMT
luehe       01/12/06 12:19:50

  Modified:    standard/examples/web/format FormatDateTime.jsp
                        ParametricReplacement.jsp
               standard/src/org/apache/taglibs/standard/tag/common/fmt
                        BundleSupport.java TimeZoneSupport.java
  Log:
  Fixed body content evaluation of <bundle> and <timeZone> handlers
  
  Revision  Changes    Path
  1.4       +14 -14    jakarta-taglibs/standard/examples/web/format/FormatDateTime.jsp
  
  Index: FormatDateTime.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/format/FormatDateTime.jsp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FormatDateTime.jsp	2001/12/03 20:33:15	1.3
  +++ FormatDateTime.jsp	2001/12/06 20:19:50	1.4
  @@ -8,6 +8,20 @@
   <h3>Formatting Dates and Times</h3>
   
   <ul>
  + <li> Formatting current date as &quot;GMT&quot;:<br>
  +  <fmt:timeZone value="GMT">
  +   <fmt:formatDate type="both" dateStyle="full" timeStyle="full"/>
  +  </fmt:timeZone>
  +
  + <li> Formatting current date as &quot;GMT+1:00&quot;, and parsing
  +      its date and time components:<br>
  +  <fmt:timeZone value="GMT+1:00">
  +   <fmt:formatDate type="both" dateStyle="full" timeStyle="full" var="formattedDateTime"/>
  +   <fmt:parseDate value="$formattedDateTime" type="both" dateStyle="full" timeStyle="full"
timeZone="PST" var="parsedDateTime"/>
  +   Parsed date: <fmt:formatDate value="$parsedDateTime" type="date" dateStyle="full"/><br>
  +   Parsed time: <fmt:formatDate value="$parsedDateTime" type="time" timeStyle="full"/>
  +  </fmt:timeZone>
  +
    <li> Parsing SHORT version of current time in different time zones:<br>
     <fmt:formatDate type="both" timeStyle="short" var="formattedDateTime"/>
     <fmt:parseDate value="$formattedDateTime" type="both" timeStyle="short" timeZone="GMT"/>
(parsed in &quot;GMT&quot;)<br>
  @@ -21,20 +35,6 @@
     <fmt:parseDate value="$formattedDateTime" type="both" timeStyle="full" timeZone="GMT+1:00"/>
(parsed in &quot;GMT+1:00&quot;)<br>
     <fmt:parseDate value="$formattedDateTime" type="both" timeStyle="full" timeZone="GMT+3:00"/>
(parsed in &quot;GMT+3:00&quot;)<br>
     <fmt:parseDate value="$formattedDateTime" type="both" timeStyle="full" timeZone="PST"/>
(parsed in &quot;PST&quot;)
  -
  - <li> Formatting current date as &quot;GMT&quot;: 
  -  <fmt:timeZone value="GMT">
  -   <fmt:formatDate type="both" dateStyle="full" timeStyle="full"/>
  -  </fmt:timeZone>
  -
  - <li> Formatting current date as &quot;GMT+1:00&quot;, and parsing
  -      its date and time components:<br>
  -  <fmt:timeZone value="GMT+1:00">
  -   <fmt:formatDate type="both" dateStyle="full" timeStyle="full" var="formattedDateTime"/>
  -   <fmt:parseDate value="$formattedDateTime" type="both" dateStyle="full" timeStyle="full"
timeZone="PST" var="parsedDateTime"/>
  -   Parsed date: <fmt:formatDate value="$parsedDateTime" type="date" dateStyle="full"/><br>
  -   Parsed time: <fmt:formatDate value="$parsedDateTime" type="time" timeStyle="full"/>
  -  </fmt:timeZone>
   </ul>
   
   </body>
  
  
  
  1.3       +1 -1      jakarta-taglibs/standard/examples/web/format/ParametricReplacement.jsp
  
  Index: ParametricReplacement.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/format/ParametricReplacement.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ParametricReplacement.jsp	2001/12/04 01:17:40	1.2
  +++ ParametricReplacement.jsp	2001/12/06 20:19:50	1.3
  @@ -29,7 +29,7 @@
      </fmt:messageArg>
     </fmt:message>
   
  - <li>
  + <li> Using 'messageArgs' attribute:<br>
     <fmt:message key="serverInfo" bundle="$deBundle" messageArgs="$messageArgs"/>
   </ul>
   
  
  
  
  1.4       +9 -2      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/BundleSupport.java
  
  Index: BundleSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/BundleSupport.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BundleSupport.java	2001/11/30 01:32:06	1.3
  +++ BundleSupport.java	2001/12/06 20:19:50	1.4
  @@ -55,6 +55,7 @@
   
   package org.apache.taglibs.standard.tag.common.fmt;
   
  +import java.io.IOException;
   import java.util.*;
   import javax.servlet.ServletContext;
   import javax.servlet.jsp.*;
  @@ -161,7 +162,7 @@
   
       public int doStartTag() throws JspException {
   	bundle = getBundle(pageContext, basename);
  -	return EVAL_BODY_INCLUDE;
  +	return EVAL_BODY_BUFFERED;
       }
   
       public int doEndTag() throws JspException {
  @@ -172,10 +173,16 @@
   		pageContext.setAttribute(var, emptyResourceBundle, scope);
   	} else if (getBodyContent() == null) {
   	    /*
  -	     * If no 'var' attribute and no body, we store our base name
  +	     * If no 'var' attribute and empty body, we store our base name
   	     * in the javax.servlet.jsp.jstl.i18n.basename scoped attribute
   	     */
   	    pageContext.setAttribute(DEFAULT_BASENAME, basename, scope);
  +	} else {
  +	    try {
  +		pageContext.getOut().print(getBodyContent().getString());
  +	    } catch (IOException ioe) {
  +		throw new JspTagException(ioe.getMessage());
  +	    }
   	}
   
   	return EVAL_PAGE;
  
  
  
  1.4       +9 -2      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/TimeZoneSupport.java
  
  Index: TimeZoneSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/TimeZoneSupport.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TimeZoneSupport.java	2001/12/03 20:33:15	1.3
  +++ TimeZoneSupport.java	2001/12/06 20:19:50	1.4
  @@ -55,6 +55,7 @@
   
   package org.apache.taglibs.standard.tag.common.fmt;
   
  +import java.io.IOException;
   import java.util.TimeZone;
   import javax.servlet.jsp.*;
   import javax.servlet.jsp.tagext.*;
  @@ -130,7 +131,7 @@
   
       public int doStartTag() throws JspException {
   	timeZone = TimeZone.getTimeZone(value);
  -	return EVAL_BODY_INCLUDE;
  +	return EVAL_BODY_BUFFERED;
       }
   
       public int doEndTag() throws JspException {
  @@ -138,10 +139,16 @@
   	    pageContext.setAttribute(var, timeZone, scope);	
   	} else if (getBodyContent() == null) {
   	    /*
  -	     * If no 'var' attribute and no body, we store our time zone
  +	     * If no 'var' attribute and empty body, we store our time zone
   	     * in the javax.servlet.jsp.jstl.i18n.timeZone scoped attribute
   	     */
   	    pageContext.setAttribute(TIMEZONE_ATTRIBUTE, timeZone, scope);
  +	} else {
  +	    try {
  +		pageContext.getOut().print(getBodyContent().getString());
  +	    } catch (IOException ioe) {
  +		throw new JspTagException(ioe.getMessage());
  +	    }
   	}
   
   	return EVAL_PAGE;
  
  
  

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message