You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2007/05/14 01:04:41 UTC
svn commit: r537674 - in /struts/struts2/trunk:
core/src/main/java/org/apache/struts2/interceptor/validation/
core/src/test/java/org/apache/struts2/interceptor/validation/
plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/
plugins/dojo/src...
Author: musachy
Date: Sun May 13 16:04:40 2007
New Revision: 537674
URL: http://svn.apache.org/viewvc?view=rev&rev=537674
Log:
* Rename ajax validation parameter to "struts.validateOnly"
* Add ajax validation parameter only when "validate" attribute is set to true
Modified:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java?view=diff&rev=537674&r1=537673&r2=537674
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java Sun May 13 16:04:40 2007
@@ -44,12 +44,13 @@
* <p>If 'validationFailedStatus' is set it will be used as the Response status
* when validation fails.</p>
*
- * <p>If the request has a parameter 'validateOnly' execution will return after
+ * <p>If the request has a parameter 'struts.validateOnly' execution will return after
* validation (action won't be executed).</p>
*/
public class JSONValidationInterceptor extends AnnotationValidationInterceptor {
private static final Log LOG = LogFactory
.getLog(JSONValidationInterceptor.class);
+ private static final String VALIDATE_ONLY_PARAM = "struts.validateOnly";
static char[] hex = "0123456789ABCDEF".toCharArray();
private int validationFailedStatus = -1;
@@ -83,7 +84,7 @@
}
}
- String validateOnly = request.getParameter("validateOnly");
+ String validateOnly = request.getParameter(VALIDATE_ONLY_PARAM);
if (validateOnly != null && "true".equals(validateOnly)) {
//there were no errors
response.getWriter().print("/* {} */");
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java?view=diff&rev=537674&r1=537673&r2=537674
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java Sun May 13 16:04:40 2007
@@ -96,7 +96,7 @@
//just validate
Map parameters = new HashMap();
- parameters.put("validateOnly", "true");
+ parameters.put("struts.validateOnly", "true");
request.setParameterMap(parameters);
interceptor.intercept(invocation);
Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js?view=diff&rev=537674&r1=537673&r2=537674
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js Sun May 13 16:04:40 2007
@@ -295,8 +295,8 @@
}
var tmpHref = this.href;
- if(!this.ajaxAfterValidation) {
- tmpHref = tmpHref + (tmpHref.indexOf("?") > -1 ? "&" : "?") + "validateOnly=true";
+ if(!this.ajaxAfterValidation && this.validate) {
+ tmpHref = tmpHref + (tmpHref.indexOf("?") > -1 ? "&" : "?") + "struts.validateOnly=true";
}
dojo.io.bind({
Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js?view=diff&rev=537674&r1=537673&r2=537674
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js Sun May 13 16:04:40 2007
@@ -13788,8 +13788,8 @@
this.setContent(this.loadingText);
}
var _b9b=this.href;
-if(!this.ajaxAfterValidation){
-_b9b=_b9b+(_b9b.indexOf("?")>-1?"&":"?")+"validateOnly=true";
+if(!this.ajaxAfterValidation&&this.validate){
+_b9b=_b9b+(_b9b.indexOf("?")>-1?"&":"?")+"struts.validateOnly=true";
}
dojo.io.bind({url:_b9b,useCache:false,preventCache:true,formNode:self.formNode,formFilter:window[self.formFilter],handler:function(type,data,e){
dojo.lang.hitch(self,"bindHandler")(type,data,e);
@@ -15649,8 +15649,6 @@
return !RTL[lang];
};
dojo.provide("dojo.date.format");
-dojo.requireLocalization("dojo.i18n.calendar","gregorian");
-dojo.requireLocalization("dojo.i18n.calendar","gregorianExtras");
(function(){
dojo.date.format=function(_d23,_d24){
if(typeof _d24=="string"){
@@ -16342,8 +16340,6 @@
return new Date(_da2[0],(parseInt(_da2[1],10)-1),_da2[2],_da2[3],_da2[4],_da2[5]);
};
dojo.provide("dojo.widget.TimePicker");
-dojo.requireLocalization("dojo.i18n.calendar","gregorian");
-dojo.requireLocalization("dojo.widget","TimePicker");
dojo.widget.defineWidget("dojo.widget.TimePicker",dojo.widget.HtmlWidget,function(){
this.time="";
this.useDefaultTime=false;
@@ -16600,7 +16596,6 @@
};
};
dojo.provide("dojo.widget.DropdownTimePicker");
-dojo.requireLocalization("dojo.widget","DropdownTimePicker");
dojo.widget.defineWidget("dojo.widget.DropdownTimePicker",dojo.widget.DropdownContainer,{iconURL:dojo.uri.moduleUri("dojo.widget","templates/images/timeIcon.gif"),formatLength:"short",displayFormat:"",timeFormat:"",saveFormat:"",value:"",name:"",postMixInProperties:function(){
dojo.widget.DropdownTimePicker.superclass.postMixInProperties.apply(this,arguments);
var _dd9=dojo.i18n.getLocalization("dojo.widget","DropdownTimePicker",this.lang);
@@ -17108,7 +17103,6 @@
dojo.html.destroyNode(this.weekTemplate);
}});
dojo.provide("dojo.widget.DropdownDatePicker");
-dojo.requireLocalization("dojo.widget","DropdownDatePicker");
dojo.widget.defineWidget("dojo.widget.DropdownDatePicker",dojo.widget.DropdownContainer,{iconURL:dojo.uri.moduleUri("dojo.widget","templates/images/dateIcon.gif"),formatLength:"short",displayFormat:"",saveFormat:"",value:"",name:"",displayWeeks:6,adjustWeeks:false,startDate:"1492-10-12",endDate:"2941-10-12",weekStartsOn:"",staticDisplay:false,postMixInProperties:function(_e3e,frag){
dojo.widget.DropdownDatePicker.superclass.postMixInProperties.apply(this,arguments);
var _e40=dojo.i18n.getLocalization("dojo.widget","DropdownDatePicker",this.lang);
Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js?view=diff&rev=537674&r1=537673&r2=537674
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js Sun May 13 16:04:40 2007
@@ -22347,8 +22347,8 @@
}
var tmpHref = this.href;
- if(!this.ajaxAfterValidation) {
- tmpHref = tmpHref + (tmpHref.indexOf("?") > -1 ? "&" : "?") + "validateOnly=true";
+ if(!this.ajaxAfterValidation && this.validate) {
+ tmpHref = tmpHref + (tmpHref.indexOf("?") > -1 ? "&" : "?") + "struts.validateOnly=true";
}
dojo.io.bind({
@@ -25435,8 +25435,8 @@
// Load the bundles containing localization information for
// names and formats
-dojo.requireLocalization("dojo.i18n.calendar", "gregorian");
-dojo.requireLocalization("dojo.i18n.calendar", "gregorianExtras");
+
+
//NOTE: Everything in this module assumes Gregorian calendars.
// Other calendars will be implemented in separate modules.
@@ -26345,8 +26345,8 @@
-dojo.requireLocalization("dojo.i18n.calendar", "gregorian");
-dojo.requireLocalization("dojo.widget", "TimePicker");
+
+
dojo.widget.defineWidget(
@@ -26738,7 +26738,7 @@
-dojo.requireLocalization("dojo.widget", "DropdownTimePicker");
+
dojo.widget.defineWidget(
"dojo.widget.DropdownTimePicker",
@@ -27546,7 +27546,7 @@
-dojo.requireLocalization("dojo.widget", "DropdownDatePicker");
+
dojo.widget.defineWidget(