[prev in list] [next in list] [prev in thread] [next in thread]
List: taglibs-dev
Subject: cvs commit: jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/rt/fmt FormatDateTag.java F
From: luehe () apache ! org
Date: 2002-02-27 0:35:15
[Download RAW message or body]
luehe 02/02/26 16:35:15
Modified: standard/conf fmt-rt.tld fmt.tld
standard/doc/web ReleaseNotes.html
standard/examples/web/format FormatNumber.jsp
standard/src/org/apache/taglibs/standard/tag/common/fmt
FormatDateSupport.java FormatNumberSupport.java
standard/src/org/apache/taglibs/standard/tag/el/fmt
FormatDateTag.java FormatNumberTag.java
standard/src/org/apache/taglibs/standard/tag/rt/fmt
FormatDateTag.java FormatNumberTag.java
Log:
Removed 'parseLocale' attribute from <fmt:formatDate> and
<fmt:formatNumber>.
If the value to be formatted is given as a String, it is now always
parsed using the "en" locale.
If the String is formatted with a different locale than "en", it must
first be parsed to a java.util.Date or java.lang.Number with
<fmt:parseDate> or <fmt:parseNumber>, and the result can then be used
with <fmt:formatDate> or <fmt:formatNumber>, respectively.
Revision Changes Path
1.10 +0 -10 jakarta-taglibs/standard/conf/fmt-rt.tld
Index: fmt-rt.tld
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/conf/fmt-rt.tld,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- fmt-rt.tld 30 Jan 2002 23:26:33 -0000 1.9
+++ fmt-rt.tld 27 Feb 2002 00:35:15 -0000 1.10
@@ -232,11 +232,6 @@
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
- <name>parseLocale</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
<name>currencyCode</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -363,11 +358,6 @@
</attribute>
<attribute>
<name>timeZone</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>parseLocale</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
1.11 +0 -12 jakarta-taglibs/standard/conf/fmt.tld
Index: fmt.tld
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/conf/fmt.tld,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- fmt.tld 30 Jan 2002 23:26:33 -0000 1.10
+++ fmt.tld 27 Feb 2002 00:35:15 -0000 1.11
@@ -33,7 +33,6 @@
messageArg:value
formatNumber:value
formatNumber:pattern
- formatNumber:parseLocale
formatNumber:currencyCode
formatNumber:currencySymbol
formatNumber:groupingUsed
@@ -48,7 +47,6 @@
formatDate:value
formatDate:pattern
formatDate:timeZone
- formatDate:parseLocale
parseDate:value
parseDate:pattern
parseDate:timeZone
@@ -286,11 +284,6 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
- <name>parseLocale</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
<name>currencyCode</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -417,11 +410,6 @@
</attribute>
<attribute>
<name>timeZone</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>parseLocale</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
1.6 +9 -0 jakarta-taglibs/standard/doc/web/ReleaseNotes.html
Index: ReleaseNotes.html
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/doc/web/ReleaseNotes.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ReleaseNotes.html 22 Feb 2002 19:01:08 -0000 1.5
+++ ReleaseNotes.html 27 Feb 2002 00:35:15 -0000 1.6
@@ -168,6 +168,15 @@
<li>Added javax.servlet.jsp.jstl.i18n.locale context configuration
parameter, which allows application locale to be specified in
deployment descriptor file.</li>
+ <li>Removed 'parseLocale' attribute from <fmt:formatDate> and
+ <fmt:formatNumber>. If the value to be formatted is given as a
+ String, it is now always parsed using the "en" locale.
+ If the String
+ is formatted with a different locale than "en", it must first be
+ parsed to a java.util.Date or java.lang.Number with
+ <fmt:parseDate> or <fmt:parseNumber>, and the result can
+ then be used with <fmt:formatDate> or <fmt:formatNumber>,
+ respectively.</li>
</ul>
</dd>
1.7 +1 -8 jakarta-taglibs/standard/examples/web/format/FormatNumber.jsp
Index: FormatNumber.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/format/FormatNumber.jsp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FormatNumber.jsp 30 Jan 2002 23:26:33 -0000 1.6
+++ FormatNumber.jsp 27 Feb 2002 00:35:15 -0000 1.7
@@ -42,16 +42,9 @@
<fmt:parseNumber value="$cur" type="currency" integerOnly="true"/>
<li> Format "12345.67" as German currency (given string is
- parsed using default "en" locale before it is formatted):<br>
+ parsed using "en" locale before it is formatted):<br>
<fmt:locale value="de-DE"/>
<fmt:formatNumber value="12345.67" type="currency"/>
-
- <li> Format "12345.67" as German currency (given string is parsed
- using "de" locale before it is formatted):<br>
- <fmt:locale value="de-DE"/>
- <fmt:formatNumber parseLocale="de" type="currency">
- 12345.67
- </fmt:formatNumber>
</ul>
</body>
1.9 +4 -11 \
jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/FormatDateSupport.java
Index: FormatDateSupport.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/FormatDateSupport.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- FormatDateSupport.java 11 Feb 2002 21:23:05 -0000 1.8
+++ FormatDateSupport.java 27 Feb 2002 00:35:15 -0000 1.9
@@ -100,7 +100,6 @@
protected Object value; // 'value' attribute
protected String pattern; // 'pattern' attribute
protected Object timeZone; // 'timeZone' attribute
- protected Locale parseLocale; // 'parseLocale' attribute
//*********************************************************************
@@ -128,7 +127,6 @@
type = DATE_TYPE;
dateStyle = timeStyle = DateFormat.DEFAULT;
scope = PageContext.PAGE_SCOPE;
- parseLocale = null;
}
@@ -171,19 +169,14 @@
* If no date or time is given, the current date and time are used.
* If the date and/or time is given as a string literal, it is first
* parsed into an instance of java.util.Date according to the default
- * pattern of the locale given via the 'parseLocale' attribute. If this
- * attribute is missing, the default ("en") locale is used.
+ * pattern of the "en" locale.
*/
if (value == null) {
value = new Date();
} else if (value instanceof String) {
- DateFormat parser = null;
- if (parseLocale != null)
- parser = DateFormat.getDateInstance(DateFormat.DEFAULT,
- parseLocale);
- else
- parser = DateFormat.getDateInstance(DateFormat.DEFAULT,
- Locale.ENGLISH);
+ DateFormat parser
+ = DateFormat.getDateInstance(DateFormat.DEFAULT,
+ Locale.ENGLISH);
try {
value = parser.parse((String) value);
} catch (ParseException pe) {
1.10 +4 -10 \
jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/FormatNumberSupport.java
Index: FormatNumberSupport.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/FormatNumberSupport.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- FormatNumberSupport.java 21 Feb 2002 02:00:41 -0000 1.9
+++ FormatNumberSupport.java 27 Feb 2002 00:35:15 -0000 1.10
@@ -101,7 +101,6 @@
protected Object value; // 'value' attribute
protected String pattern; // 'pattern' attribute
- protected Locale parseLocale; // 'parseLocale' attribute
protected String currencyCode; // 'currencyCode' attribute
protected String currencySymbol; // 'currencySymbol' attribute
protected boolean isGroupingUsed; // 'groupingUsed' attribute
@@ -147,7 +146,6 @@
groupingUsedSpecified = false;
maxIntegerDigitsSpecified = minIntegerDigitsSpecified = false;
maxFractionDigitsSpecified = minFractionDigitsSpecified = false;
- parseLocale = null;
type = NUMBER_TYPE;
scope = PageContext.PAGE_SCOPE;
}
@@ -194,16 +192,12 @@
/*
* If 'value' is a String, it is first parsed into an instance of
- * java.lang.Number according to the default pattern of the locale
- * given via the 'parseLocale' attribute. If this attribute is missing,
- * the default ("en") locale is used.
+ * java.lang.Number according to the default pattern of the "en"
+ * locale.
*/
if (value instanceof String) {
- NumberFormat parser = null;
- if (parseLocale != null)
- parser = NumberFormat.getNumberInstance(parseLocale);
- else
- parser = NumberFormat.getNumberInstance(Locale.ENGLISH);
+ NumberFormat parser
+ = NumberFormat.getNumberInstance(Locale.ENGLISH);
try {
value = parser.parse((String) value);
} catch (ParseException pe) {
1.4 +1 -13 \
jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/fmt/FormatDateTag.java
Index: FormatDateTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/fmt/FormatDateTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FormatDateTag.java 9 Jan 2002 19:51:47 -0000 1.3
+++ FormatDateTag.java 27 Feb 2002 00:35:15 -0000 1.4
@@ -76,7 +76,6 @@
private String value_; // stores EL-based property
private String pattern_; // stores EL-based property
private String timeZone_; // stores EL-based property
- private String parseLocale_; // stores EL-based property
//*********************************************************************
@@ -131,11 +130,6 @@
this.timeZone_ = timeZone_;
}
- // for EL-based attribute
- public void setParseLocale(String parseLocale_) {
- this.parseLocale_ = parseLocale_;
- }
-
//*********************************************************************
// Private (utility) methods
@@ -143,7 +137,7 @@
// (re)initializes state (during release() or construction)
private void init() {
// null implies "no expression"
- value_ = pattern_ = timeZone_ = parseLocale_ = null;
+ value_ = pattern_ = timeZone_ = null;
}
// Evaluates expressions as necessary
@@ -165,11 +159,5 @@
timeZone = ExpressionUtil.evalNotNull(
"formatDate", "timeZone", timeZone_, Object.class, this,
pageContext);
-
- String pl = (String) ExpressionUtil.evalNotNull(
- "formatDate", "parseLocale", parseLocale_, String.class, this,
- pageContext);
- if (pl != null)
- parseLocale = LocaleSupport.parseLocale(pl, null);
}
}
1.4 +4 -14 \
jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/fmt/FormatNumberTag.java
Index: FormatNumberTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/fmt/FormatNumberTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FormatNumberTag.java 30 Jan 2002 23:26:33 -0000 1.3
+++ FormatNumberTag.java 27 Feb 2002 00:35:15 -0000 1.4
@@ -75,7 +75,6 @@
private String value_; // stores EL-based property
private String pattern_; // stores EL-based property
- private String parseLocale_; // stores EL-based property
private String currencyCode_; // stores EL-based property
private String currencySymbol_; // stores EL-based property
private String groupingUsed_; // stores EL-based property
@@ -133,11 +132,6 @@
}
// for EL-based attribute
- public void setParseLocale(String parseLocale_) {
- this.parseLocale_ = parseLocale_;
- }
-
- // for EL-based attribute
public void setCurrencyCode(String currencyCode_) {
this.currencyCode_ = currencyCode_;
}
@@ -184,7 +178,7 @@
// (re)initializes state (during release() or construction)
private void init() {
// null implies "no expression"
- value_ = pattern_ = parseLocale_ = null;
+ value_ = pattern_ = null;
currencyCode_ = currencySymbol_ = null;
groupingUsed_ = null;
maxIntegerDigits_ = minIntegerDigits_ = null;
@@ -206,21 +200,17 @@
value = ExpressionUtil.evalNotNull(
"formatNumber", "value", value_, Object.class, this, pageContext);
+ // pattern
pattern = (String) ExpressionUtil.evalNotNull(
"formatNumber", "pattern", pattern_, String.class, this,
pageContext);
- // parseLocale
- r = ExpressionUtil.evalNotNull(
- "formatNumber", "parseLocale", parseLocale_, String.class, this,
- pageContext);
- if (r != null)
- parseLocale = LocaleSupport.parseLocale((String) r, null);
-
+ // currencyCode
currencyCode = (String) ExpressionUtil.evalNotNull(
"formatNumber", "currencyCode", currencyCode_, String.class, this,
pageContext);
+ // currencySymbol
currencySymbol = (String) ExpressionUtil.evalNotNull(
"formatNumber", "currencySymbol", currencySymbol_, String.class,
this, pageContext);
1.4 +0 -5 \
jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/rt/fmt/FormatDateTag.java
Index: FormatDateTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/rt/fmt/FormatDateTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FormatDateTag.java 9 Jan 2002 19:51:47 -0000 1.3
+++ FormatDateTag.java 27 Feb 2002 00:35:15 -0000 1.4
@@ -86,9 +86,4 @@
public void setTimeZone(Object timeZone) throws JspTagException {
this.timeZone = timeZone;
}
-
- // for tag attribute
- public void setParseLocale(String parseLocale) throws JspTagException {
- this.parseLocale = LocaleSupport.parseLocale(parseLocale, null);
- }
}
1.4 +0 -5 \
jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/rt/fmt/FormatNumberTag.java
Index: FormatNumberTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/rt/fmt/FormatNumberTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FormatNumberTag.java 30 Jan 2002 23:26:33 -0000 1.3
+++ FormatNumberTag.java 27 Feb 2002 00:35:15 -0000 1.4
@@ -83,11 +83,6 @@
}
// for tag attribute
- public void setParseLocale(String parseLocale) throws JspTagException {
- this.parseLocale = LocaleSupport.parseLocale(parseLocale, null);
- }
-
- // for tag attribute
public void setCurrencyCode(String currencyCode) throws JspTagException {
this.currencyCode = currencyCode;
}
--
To unsubscribe, e-mail: <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic