Revision: 1092
http://stripes.svn.sourceforge.net/stripes/?rev=1092&view=rev
Author: bengunter
Date: 2009-03-03 15:22:51 +0000 (Tue, 03 Mar 2009)
Log Message:
-----------
Applied fix for STS-251 (take 2) from trunk.
Modified Paths:
--------------
branches/1.5.x/stripes/resources/stripes.tld
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/InputOptionTag.java
Property Changed:
----------------
branches/1.5.x/
Property changes on: branches/1.5.x
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/1.5.x:1091
Modified: branches/1.5.x/stripes/resources/stripes.tld
===================================================================
--- branches/1.5.x/stripes/resources/stripes.tld 2009-03-03 15:17:55 UTC
(rev 1091)
+++ branches/1.5.x/stripes/resources/stripes.tld 2009-03-03 15:22:51 UTC
(rev 1092)
@@ -970,6 +970,13 @@
<p>If the option has a body then the String value of that body
will be used to generate
the body of the generated HTML option. If the body is empty or
not present then the
label attribute will be written into the body of the tag.</p>
+
+ <p>If the label attribute's value is used, it will be HTML-encoded
before being written
+ out. However, the tag body, if present, will <em>not</em> be
HTML-encoded. This allows
+ the explicit use of HTML character entities within the tag, which
would be impossible
+ otherwise. If you choose to set the tag body and you want the
output to be HTML-encoded,
+ you must use something like the escapeXml attribute of the
<c:out> tag to
+ HTML-encode the value before passing it to
<stripes:option>.</p>
]]></description>
<display-name>option</display-name>
<name>option</name>
Modified:
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/InputOptionTag.java
===================================================================
--- branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/InputOptionTag.java
2009-03-03 15:17:55 UTC (rev 1091)
+++ branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/InputOptionTag.java
2009-03-03 15:22:51 UTC (rev 1092)
@@ -108,7 +108,7 @@
// Decide if the label will come from the body of the option, of the
label attr
String actualLabel = getBodyContentAsString();
if (actualLabel == null) {
- actualLabel = this.label;
+ actualLabel = HtmlUtil.encode(this.label);
}
// If no explicit value attribute set, use the tag label as the value
@@ -130,7 +130,7 @@
try {
writeOpenTag(getPageContext().getOut(), "option");
if (actualLabel != null) {
- getPageContext().getOut().write(HtmlUtil.encode(actualLabel));
+ getPageContext().getOut().write(actualLabel);
}
writeCloseTag(getPageContext().getOut(), "option");
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development