You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by fe...@apache.org on 2004/06/04 06:35:44 UTC
cvs commit: jakarta-taglibs/i18n/src/org/apache/taglibs/i18n MessageTag.java
felipeal 2004/06/03 21:35:44
Modified: i18n/src/org/apache/taglibs/i18n MessageTag.java
Log:
fix for bug 18521 - MessageTag body misuse (Thanks Patrick Samsom for the patch
Revision Changes Path
1.9 +14 -6 jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/MessageTag.java
Index: MessageTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/MessageTag.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- MessageTag.java 4 Jun 2004 04:30:52 -0000 1.8
+++ MessageTag.java 4 Jun 2004 04:35:44 -0000 1.9
@@ -208,6 +208,20 @@
}
/**
+ * If key is not found, use the body content as a default value.
+ */
+ public int doAfterBody() throws JspException
+ {
+ // if the value is null, use the body content
+ if ( _value == null ) {
+ _value = bodyContent.getString();
+ }
+ // cleanup
+ bodyContent.clearBody();
+ return SKIP_BODY;
+ }
+
+ /**
* Performs the proper runtime substitution. If an id attribute was
* specified, then it is assumed that this tag is merely defining a
* string variable; otherwise output is provided.
@@ -215,12 +229,6 @@
public final int doEndTag() throws JspException
{
try {
- // if the value is null, use the body content
- if ( _value == null ) {
- _value = bodyContent.getString();
- bodyContent.clear();
- }
-
// perform parameter substitutions
if ( _value != null && _arguments != null && _arguments.size() > 0) {
// reformat the value as specified
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org