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 lu...@apache.org on 2002/01/25 20:21:57 UTC
cvs commit: jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt MessageSupport.java MessageFormatSupport.java
luehe 02/01/25 11:21:57
Modified: standard/src/org/apache/taglibs/standard/resources
Resources.properties
standard/src/org/apache/taglibs/standard/tag/common/fmt
MessageSupport.java MessageFormatSupport.java
Log:
Enforce the following constraints:
- <fmt:message>: If "key" attribute is present and action has body, its
body content must be empty after trimming.
- <fmt:messageFormat>: If "value" attribute is present and action has body, its
body content must be empty after trimming.
Revision Changes Path
1.8 +6 -0 jakarta-taglibs/standard/src/org/apache/taglibs/standard/resources/Resources.properties
Index: Resources.properties
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/resources/Resources.properties,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Resources.properties 9 Jan 2002 19:51:47 -0000 1.7
+++ Resources.properties 25 Jan 2002 19:21:57 -0000 1.8
@@ -95,8 +95,14 @@
MESSAGE_NO_KEY=\
<message> must have "key" attribute or body
+MESSAGE_ILLEGAL_BODY_CONTENT=\
+ <message> must have empty body content if "key" attribute is present
+
MESSAGE_FORMAT_NO_VALUE=\
<messageFormat> must have "value" attribute or body
+
+MESSAGE_FORMAT_ILLEGAL_BODY_CONTENT=\
+ <messageFormat> must have empty body content if "value" attribute is present
MESSAGE_ARG_NO_VALUE=\
<messageArg> must have "value" attribute or body
1.5 +7 -0 jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/MessageSupport.java
Index: MessageSupport.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/MessageSupport.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MessageSupport.java 18 Dec 2001 02:43:28 -0000 1.4
+++ MessageSupport.java 25 Jan 2002 19:21:57 -0000 1.5
@@ -147,6 +147,13 @@
if ((bcs == null) || (key = bcs.trim()).equals(""))
throw new JspTagException(
Resources.getMessage("MESSAGE_NO_KEY"));
+ } else {
+ if (getBodyContent() != null) {
+ String bcs = getBodyContent().getString();
+ if ((bcs != null) && !bcs.trim().equals(""))
+ throw new JspTagException(
+ Resources.getMessage("MESSAGE_ILLEGAL_BODY_CONTENT"));
+ }
}
String prefix = null;
1.4 +7 -0 jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/MessageFormatSupport.java
Index: MessageFormatSupport.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/MessageFormatSupport.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MessageFormatSupport.java 18 Dec 2001 02:43:28 -0000 1.3
+++ MessageFormatSupport.java 25 Jan 2002 19:21:57 -0000 1.4
@@ -138,6 +138,13 @@
if ((bcs == null) || (value = bcs.trim()).equals(""))
throw new JspTagException(
Resources.getMessage("MESSAGE_FORMAT_NO_VALUE"));
+ } else {
+ if (getBodyContent() != null) {
+ String bcs = getBodyContent().getString();
+ if ((bcs != null) && !bcs.trim().equals(""))
+ throw new JspTagException(
+ Resources.getMessage("MESSAGE_FORMAT_ILLEGAL_BODY_CONTENT"));
+ }
}
String message = value;
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>