craigmcc 02/03/15 20:02:07
Modified: doc/userGuide struts-html.xml
src/share/org/apache/struts/taglib/html OptionsTag.java
Log:
Add a "filter" attribute to the <html:options> tag so that you can turn off
filtering on option labels. Defaults to "true" for consistency with the
previous behavior.
PR: Bugzilla #6345
Submitted by: Dave Terrian <dterrian at logiclink.com>
Revision Changes Path
1.4 +11 -0 jakarta-struts/doc/userGuide/struts-html.xml
Index: struts-html.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/doc/userGuide/struts-html.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- struts-html.xml 3 Mar 2002 03:31:13 -0000 1.3
+++ struts-html.xml 16 Mar 2002 04:02:07 -0000 1.4
@@ -3494,6 +3494,17 @@
</attribute>
<attribute>
+ <name>filter</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Set to <code>false</code> if you do NOT want the option labels
+ filtered for sensitive characters in HTML. By default, such
+ values are filtered.
+ </info>
+ </attribute>
+
+ <attribute>
<name>labelName</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
1.16 +20 -1
jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java
Index: OptionsTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- OptionsTag.java 12 Mar 2002 05:46:08 -0000 1.15
+++ OptionsTag.java 16 Mar 2002 04:02:07 -0000 1.16
@@ -111,6 +111,20 @@
/**
+ * Should the label values be filtered for HTML sensitive characters?
+ */
+ protected boolean filter = true;
+
+ public boolean getFilter() {
+ return filter;
+ }
+
+ public void setFilter(boolean filter) {
+ this.filter = filter;
+ }
+
+
+ /**
* The name of the bean containing the labels collection.
*/
protected String labelName = null;
@@ -324,6 +338,7 @@
super.release();
collection = null;
+ filter = true;
labelName = null;
labelProperty = null;
name = null;
@@ -365,7 +380,11 @@
sb.append("\"");
}
sb.append(">");
- sb.append(ResponseUtils.filter(label));
+ if (filter) {
+ sb.append(ResponseUtils.filter(label));
+ } else {
+ sb.append(label);
+ }
sb.append("</option>\r\n");
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>