dmkarr 2003/01/17 21:04:14
Modified: contrib/struts-el/doc/userGuide struts-html-el.xml
contrib/struts-el/src/share/org/apache/strutsel/taglib/html
ELJavascriptValidatorTag.java
ELJavascriptValidatorTagBeanInfo.java
Log:
Added "cdata" attribute to "html-el:javascript" to match attribute added to
"html:javascript".
Revision Changes Path
1.16 +17 -0
jakarta-struts/contrib/struts-el/doc/userGuide/struts-html-el.xml
Index: struts-html-el.xml
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-el/doc/userGuide/struts-html-el.xml,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- struts-html-el.xml 13 Jan 2003 00:00:47 -0000 1.15
+++ struts-html-el.xml 18 Jan 2003 05:04:14 -0000 1.16
@@ -2933,6 +2933,23 @@
</p>
</info>
+ <attribute>
+ <name>cdata</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <info>
+ <p>
+ If set to "true" and XHTML has been enabled, the JavaScript will
+ be wrapped in a CDATA section to prevent XML parsing. Current
browsers
+ don't support this convention, causing the scripts to fail. To
allow the
+ script to work in current browsers as well as hide it from XML
parsers you
+ need to set this attribute to "false" and htmlComment to "true".
The default is
+ "true" to comply with the W3C's recommendation.
+ </p>
+ </info>
+ <since>Struts 1.1</since>
+ </attribute>
+
<attribute>
<name>dynamicJavascript</name>
<required>false</required>
1.5 +11 -4
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELJavascriptValidatorTag.java
Index: ELJavascriptValidatorTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELJavascriptValidatorTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ELJavascriptValidatorTag.java 26 Oct 2002 05:24:44 -0000 1.4
+++ ELJavascriptValidatorTag.java 18 Jan 2003 05:04:14 -0000 1.5
@@ -152,6 +152,13 @@
*/
private void evaluateExpressions() throws JspException {
try {
+ setCdata((String) evalAttr("cdata", getCdata(),
+ String.class));
+ } catch (NullAttributeException ex) {
+ setCdata(null);
+ }
+
+ try {
setDynamicJavascript((String) evalAttr("dynamicJavascript",
getDynamicJavascript(),
String.class));
1.2 +14 -11
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELJavascriptValidatorTagBeanInfo.java
Index: ELJavascriptValidatorTagBeanInfo.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELJavascriptValidatorTagBeanInfo.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ELJavascriptValidatorTagBeanInfo.java 26 Oct 2002 05:24:44 -0000 1.1
+++ ELJavascriptValidatorTagBeanInfo.java 18 Jan 2003 05:04:14 -0000 1.2
@@ -85,28 +85,31 @@
{
public PropertyDescriptor[] getPropertyDescriptors()
{
- PropertyDescriptor[] result = new PropertyDescriptor[7];
+ PropertyDescriptor[] result = new PropertyDescriptor[8];
try {
- result[0] = new PropertyDescriptor("dynamicJavascript",
+ result[0] = new PropertyDescriptor("cdata",
+ ELJavascriptValidatorTag.class,
+ null, "setCdata");
+ result[1] = new PropertyDescriptor("dynamicJavascript",
ELJavascriptValidatorTag.class,
null, "setDynamicJavascript");
- result[1] = new PropertyDescriptor("formName",
+ result[2] = new PropertyDescriptor("formName",
ELJavascriptValidatorTag.class,
null, "setFormName");
- result[2] = new PropertyDescriptor("method",
+ result[3] = new PropertyDescriptor("method",
ELJavascriptValidatorTag.class,
null, "setMethod");
- result[3] = new PropertyDescriptor("page",
+ result[4] = new PropertyDescriptor("page",
ELJavascriptValidatorTag.class,
null, "setPageExpr");
- result[4] = new PropertyDescriptor("src",
+ result[5] = new PropertyDescriptor("src",
ELJavascriptValidatorTag.class,
null, "setSrc");
- result[5] = new PropertyDescriptor("staticJavascript",
+ result[6] = new PropertyDescriptor("staticJavascript",
ELJavascriptValidatorTag.class,
null, "setStaticJavascript");
- result[6] = new PropertyDescriptor("htmlComment",
+ result[7] = new PropertyDescriptor("htmlComment",
ELJavascriptValidatorTag.class,
null, "setHtmlComment");
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>