Repository: struts
Updated Branches:
  refs/heads/master 18fc7eb15 -> f819486c3


WW-4505 Add plugin to support bean validation

- Add pre configured interceptor stack to use bean validation with rest plugin


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/f819486c
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/f819486c
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/f819486c

Branch: refs/heads/master
Commit: f819486c34ca73ff30d8ef8e226b6b2aa88b9d3e
Parents: 18fc7eb
Author: Johannes Geppert <jo...@apache.org>
Authored: Thu Sep 24 19:59:35 2015 +0200
Committer: Johannes Geppert <jo...@apache.org>
Committed: Thu Sep 24 19:59:35 2015 +0200

----------------------------------------------------------------------
 .../src/main/resources/struts-plugin.xml        | 41 ++++++++++++++++++++
 .../rest/src/main/resources/struts-plugin.xml   |  4 +-
 2 files changed, 42 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/f819486c/plugins/bean-validation/src/main/resources/struts-plugin.xml
----------------------------------------------------------------------
diff --git a/plugins/bean-validation/src/main/resources/struts-plugin.xml 
b/plugins/bean-validation/src/main/resources/struts-plugin.xml
index b45c6cb..523082f 100644
--- a/plugins/bean-validation/src/main/resources/struts-plugin.xml
+++ b/plugins/bean-validation/src/main/resources/struts-plugin.xml
@@ -72,4 +72,45 @@
         <default-interceptor-ref name="beanValidationDefaultStack"/>
 
     </package>
+
+    <package name="struts-rest-bean-validation" extends="rest-default">
+        <interceptors>
+            <interceptor name="beanValidation" 
class="org.apache.struts.beanvalidation.validation.interceptor.BeanValidationInterceptor"/>
+
+            <interceptor-stack name="restBeanValidationStack">
+                <interceptor-ref name="exception"/>
+                <interceptor-ref name="alias"/>
+                <interceptor-ref name="servletConfig"/>
+                <interceptor-ref name="messages">
+                    <param name="operationMode">AUTOMATIC</param>
+                </interceptor-ref>
+                <interceptor-ref name="prepare"/>
+                <interceptor-ref name="i18n"/>
+                <interceptor-ref name="chain"/>
+                <interceptor-ref name="debugging"/>
+                <interceptor-ref name="profiling"/>
+                <interceptor-ref name="actionMappingParams"/>
+                <interceptor-ref name="scopedModelDriven"/>
+                <interceptor-ref name="modelDriven">
+                    <param name="refreshModelBeforeResult">true</param>
+                </interceptor-ref>
+                <interceptor-ref name="fileUpload"/>
+                <interceptor-ref name="checkbox"/>
+                <interceptor-ref name="staticParams"/>
+                <interceptor-ref name="params"/>
+                <interceptor-ref name="rest" />
+                <interceptor-ref name="conversionError"/>
+                <interceptor-ref name="beanValidation">
+                    <param 
name="excludeMethods">input,back,cancel,browse,index,show,edit,editNew</param>
+                </interceptor-ref>
+                <interceptor-ref name="restWorkflow">
+                    <param 
name="excludeMethods">input,back,cancel,browse,index,show,edit,editNew</param>
+                </interceptor-ref>
+            </interceptor-stack>
+
+        </interceptors>
+
+        <default-interceptor-ref name="beanValidationDefaultStack"/>
+
+    </package>
 </struts>

http://git-wip-us.apache.org/repos/asf/struts/blob/f819486c/plugins/rest/src/main/resources/struts-plugin.xml
----------------------------------------------------------------------
diff --git a/plugins/rest/src/main/resources/struts-plugin.xml 
b/plugins/rest/src/main/resources/struts-plugin.xml
index 0f0937e..6607dcf 100644
--- a/plugins/rest/src/main/resources/struts-plugin.xml
+++ b/plugins/rest/src/main/resources/struts-plugin.xml
@@ -92,9 +92,7 @@
                 <interceptor-ref name="fileUpload"/>
                 <interceptor-ref name="checkbox"/>
                 <interceptor-ref name="staticParams"/>
-                <interceptor-ref name="params">
-                  <param name="excludeParams">dojo\..*</param>
-                </interceptor-ref>
+                <interceptor-ref name="params"/>
                 <interceptor-ref name="rest" />
                 <interceptor-ref name="conversionError"/>
                 <interceptor-ref name="validation">

Reply via email to