diff --git a/core/src/main/resources/org/apache/struts2/static/utils.js b/core/src/main/resources/org/apache/struts2/static/utils.js index 1779ce57a5..9708f6f0b7 100644 --- a/core/src/main/resources/org/apache/struts2/static/utils.js +++ b/core/src/main/resources/org/apache/struts2/static/utils.js @@ -66,8 +66,8 @@ StrutsUtils.showValidationErrors = function(form, errors) { if (errors.errors) { var l, errorList = document.createElement("ul"); - errorList.setAttribute("class", "errorMessage"); - errorList.setAttribute("className", "errorMessage"); // ie hack cause ie does not support setAttribute + errorList.setAttribute("class", "struts-errorMessage"); + errorList.setAttribute("className", "struts-errorMessage"); // ie hack cause ie does not support setAttribute for ( l = 0; l < errors.errors.length; l++) { var item = document.createElement("li"); diff --git a/core/src/main/resources/template/archive/ajax/form.vm b/core/src/main/resources/template/archive/ajax/form.vm index 2ad6075e70..35f3b43398 100644 --- a/core/src/main/resources/template/archive/ajax/form.vm +++ b/core/src/main/resources/template/archive/ajax/form.vm @@ -36,4 +36,4 @@ #if ($parameters.cssStyle) style="$!struts.htmlEncode($parameters.cssStyle)" #end onSubmit="return false;" > -
#parse("$!{tag.templateDir}/simple/checkbox.vm") | -+ |
+ | <#assign addLabel=(parameters.addLabel!"->")?html /><#t/> <#t/> diff --git a/core/src/main/resources/template/simple/optiontransferselect.ftl b/core/src/main/resources/template/simple/optiontransferselect.ftl index c685956815..eda4a7ee41 100644 --- a/core/src/main/resources/template/simple/optiontransferselect.ftl +++ b/core/src/main/resources/template/simple/optiontransferselect.ftl @@ -47,7 +47,7 @@ #if> | -+ | <#if parameters.allowAddToLeft?default(true)><#t/> <#assign addToLeftLabel = parameters.addToLeftLabel?default("<-")?html/><#t/> <#if parameters.doubleHeaderKey??><#t/> diff --git a/core/src/main/resources/template/xhtml/checkbox.ftl b/core/src/main/resources/template/xhtml/checkbox.ftl index d845065386..08c5732c4a 100644 --- a/core/src/main/resources/template/xhtml/checkbox.ftl +++ b/core/src/main/resources/template/xhtml/checkbox.ftl @@ -28,8 +28,8 @@ errorFor="${parameters.id}"<#rt/> #if> > - | <#rt/> - ${error?html}<#t/> + | <#rt/> + ${error?html}<#t/> | <#lt/> #list> @@ -47,17 +47,17 @@ for="${parameters.id?html}"<#rt/> #if> <#if hasFieldErrors> - class="checkboxErrorLabel"<#rt/> + class="struts-checkboxErrorLabel"<#rt/> <#else> - class="checkboxLabel"<#rt/> + class="struts-checkboxLabel"<#rt/> #if> > <#if parameters.required?default(false) && parameters.requiredPosition?default("right") != 'right'> - *<#t/> + *<#t/> #if> ${parameters.label?html}<#t/> <#if parameters.required?default(false) && parameters.requiredPosition?default("right") == 'right'> - *<#t/> + *<#t/> #if> :<#t/> <#if parameters.tooltip??> @@ -72,24 +72,24 @@ ${parameters.label?html}<#t/> <#include "/${parameters.templateDir}/simple/checkbox.ftl" /> <#else>|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+ | <#if labelpos?default("") == 'left'> <#if parameters.label??> <#if parameters.id??> for="${parameters.id?html}"<#rt/> #if> <#if hasFieldErrors> - class="checkboxErrorLabel"<#rt/> + class="struts-checkboxErrorLabel"<#rt/> <#else> - class="checkboxLabel"<#rt/> + class="struts-checkboxLabel"<#rt/> #if> > <#if parameters.required?default(false) && parameters.requiredPosition?default("right") != 'right'> - *<#t/> + *<#t/> #if> ${parameters.label?html}<#t/> <#if parameters.required?default(false) && parameters.requiredPosition?default("right") == 'right'> - *<#t/> + *<#t/> #if> :<#t/> <#if parameters.tooltip??> @@ -100,14 +100,14 @@ ${parameters.label?html}<#t/> #if> <#if labelpos?default("") == 'right'> <#if parameters.required?default(false)> - *<#t/> + *<#t/> #if> <#if parameters.tooltip??> <#include "/${parameters.templateDir}/${parameters.expandTheme}/tooltip.ftl" /> #if> #if> | -+ |
<#if labelpos?default("") != 'top'>
<#include "/${parameters.templateDir}/simple/checkbox.ftl" />
@@ -118,9 +118,9 @@ ${parameters.label?html}<#t/>
for="${parameters.id?html}"<#rt/>
#if>
<#if hasFieldErrors>
- class="checkboxErrorLabel"<#rt/>
+ class="struts-checkboxErrorLabel"<#rt/>
<#else>
- class="checkboxLabel"<#rt/>
+ class="struts-checkboxLabel"<#rt/>
#if>
>${parameters.label?html}<#rt/>
#if>
diff --git a/core/src/main/resources/template/xhtml/control.ftl b/core/src/main/resources/template/xhtml/control.ftl
index 2761ac3b80..91402b36b8 100644
--- a/core/src/main/resources/template/xhtml/control.ftl
+++ b/core/src/main/resources/template/xhtml/control.ftl
@@ -20,7 +20,7 @@
* under the License.
*/
-->
- | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<#rt/> - ${error?html}<#t/> + | <#rt/> + ${error?html}<#t/> | <#lt/>|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<#rt/> - ${error?html}<#t/> + | <#rt/> + ${error?html}<#t/> | <#lt/>|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<#rt/> + | <#rt/> <#else> - | <#rt/> + | <#rt/> #if> <#if parameters.label??> @@ -57,17 +57,17 @@ for="${parameters.id?html}" <#t/> #if> <#if hasFieldErrors> - class="errorLabel"<#t/> + class="struts-errorLabel"<#t/> <#else> - class="label"<#t/> + class="struts-label"<#t/> #if> ><#t/> <#if parameters.required?default(false) && parameters.requiredPosition?default("right") != 'right'> - *<#t/> + *<#t/> #if> ${parameters.label?html}<#t/> <#if parameters.required?default(false) && parameters.requiredPosition?default("right") == 'right'> - *<#t/> + *<#t/> #if> ${parameters.labelseparator?default(":")?html}<#t/> <#include "/${parameters.templateDir}/${parameters.expandTheme}/tooltip.ftl" /> diff --git a/core/src/main/resources/template/xhtml/reset.ftl b/core/src/main/resources/template/xhtml/reset.ftl index 7d6121c389..3fd3eb371a 100644 --- a/core/src/main/resources/template/xhtml/reset.ftl +++ b/core/src/main/resources/template/xhtml/reset.ftl @@ -21,7 +21,7 @@ */ --> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<#t/>
+ <#t/>
<#include "/${parameters.templateDir}/simple/reset.ftl" />
<#t/>
<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" />
diff --git a/core/src/main/resources/template/xhtml/styles.css b/core/src/main/resources/template/xhtml/styles.css
index 91d5171eee..7e8fc123a6 100644
--- a/core/src/main/resources/template/xhtml/styles.css
+++ b/core/src/main/resources/template/xhtml/styles.css
@@ -19,19 +19,19 @@
* under the License.
*/
-.wwFormTable {}
-.label {font-style:italic; }
-.errorLabel {font-style:italic; color:red; }
-.errorMessage {font-weight:bold; color:red; }
-.checkboxLabel {}
-.checkboxErrorLabel {color:red; }
-.required {color:red;}
-.tdLabel {text-align:right; vertical-align:top; }
+.struts-wwFormTable {}
+.struts-label {font-style:italic; }
+.struts-errorLabel {font-style:italic; color:red; }
+.struts-errorMessage {font-weight:bold; color:red; }
+.struts-checkboxLabel {}
+.struts-checkboxErrorLabel {color:red; }
+.struts-required {color:red;}
+.struts-tdLabel {text-align:right; vertical-align:top; }
-.tdTransferSelect {text-align:center; vertical-align:middle;}
-.tdLabelTop {text-align:left; vertical-align:top;}
-.tdCheckboxLabel {text-align:right; vertical-align:top;}
-.tdCheckboxInput {text-align:left; vertical-align:top;}
-.tdCheckboxErrorMessage {text-align:left; vertical-align:top;}
-.tdErrorMessage {text-align:center; vertical-align:top;}
-.formButton {text-align:right;}
+.struts-tdTransferSelect {text-align:center; vertical-align:middle;}
+.struts-tdLabelTop {text-align:left; vertical-align:top;}
+.struts-tdCheckboxLabel {text-align:right; vertical-align:top;}
+.struts-tdCheckboxInput {text-align:left; vertical-align:top;}
+.struts-tdCheckboxErrorMessage {text-align:left; vertical-align:top;}
+.struts-tdErrorMessage {text-align:center; vertical-align:top;}
+.struts-formButton {text-align:right;}
diff --git a/core/src/main/resources/template/xhtml/submit.ftl b/core/src/main/resources/template/xhtml/submit.ftl
index 989e816560..a5c294792f 100644
--- a/core/src/main/resources/template/xhtml/submit.ftl
+++ b/core/src/main/resources/template/xhtml/submit.ftl
@@ -21,5 +21,5 @@
*/
-->
<#t/>
+ <#t/>
<#include "/${parameters.templateDir}/simple/submit.ftl" />
diff --git a/core/src/main/resources/template/xhtml/validation.js b/core/src/main/resources/template/xhtml/validation.js
index feb1a9d143..5600ec87c3 100644
--- a/core/src/main/resources/template/xhtml/validation.js
+++ b/core/src/main/resources/template/xhtml/validation.js
@@ -109,10 +109,10 @@ function addErrorXHTML(e, errorText) {
var tr = document.createElement("tr");
var td = document.createElement("td");
var span = document.createElement("span");
- td.className = "tdErrorMessage";
+ td.className = "struts-tdErrorMessage";
td.colSpan = 2;
- span.setAttribute("class", "errorMessage");
- span.setAttribute("className", "errorMessage"); //ie hack cause ie does not support setAttribute
+ span.setAttribute("class", "struts-errorMessage");
+ span.setAttribute("className", "struts-errorMessage"); //ie hack cause ie does not support setAttribute
span.appendChild(error);
td.appendChild(span);
tr.appendChild(td);
@@ -124,8 +124,8 @@ function addErrorXHTML(e, errorText) {
var labelRow = row.cells.length > 1 ? row : StrutsUtils.previousElement(tr, "tr");
var label = labelRow.cells[0].getElementsByTagName("label")[0];
if (label) {
- label.setAttribute("class", "errorLabel");
- label.setAttribute("className", "errorLabel"); //ie hack cause ie does not support setAttribute
+ label.setAttribute("class", "struts-errorLabel");
+ label.setAttribute("className", "struts-errorLabel"); //ie hack cause ie does not support setAttribute
}
} catch (err) {
alert(err);
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/ui/ActionErrorTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/ui/ActionErrorTagTest.java
index 6b467e0615..7115f22cb9 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/ui/ActionErrorTagTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/ui/ActionErrorTagTest.java
@@ -64,7 +64,7 @@ public void testActionErrorsEscape() throws Exception {
tag.doStartTag();
tag.doEndTag();
- assertEquals(normalize("
+ |
|
-
+ |
-
+
|
+ |
|
-
+ |
-
+
|
Some Foo Error |
+ Some Foo Error |
Another Foo Error |
+ Another Foo Error |
+ |
|
-
+ |
-
+
|
Some Foo Error |
+ Some Foo Error |
Another Foo Error |
+ Another Foo Error |
+ |
|
-
+ |
-
+
|
-
+
|
-
+ |
+
|
-
+ |
|
diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Checkbox-6.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Checkbox-6.txt
index c54c8629ad..6d14c1ffa5 100644
--- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Checkbox-6.txt
+++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Checkbox-6.txt
@@ -1,9 +1,9 @@
+ |
|
-
+ |
-
+
|
+ |
|
-
+
-
+
-
+
|
+ |
|
-
+
-
+
-
+
|
+ |
|
-
+
-
+
-
+
|
+ |
|
-
+
-
+
|
+ |
|
| |