cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5775] Ignore defaut fault logging on the JAX-RS path
Date Tue, 03 Jun 2014 13:12:03 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 4604c9fe2 -> c9af77e94


[CXF-5775] Ignore defaut fault logging on the JAX-RS path


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

Branch: refs/heads/master
Commit: c9af77e944aeb0adc14f4fb905f9676d93fe2abc
Parents: 4604c9f
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Jun 3 14:11:44 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Jun 3 14:11:44 2014 +0100

----------------------------------------------------------------------
 .../JAXRSBeanValidationInInterceptor.java           | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c9af77e9/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSBeanValidationInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSBeanValidationInInterceptor.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSBeanValidationInInterceptor.java
index 69f62b1..a1423c3 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSBeanValidationInInterceptor.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/JAXRSBeanValidationInInterceptor.java
@@ -19,12 +19,17 @@
 package org.apache.cxf.jaxrs.validation;
 
 import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.List;
 
+import javax.validation.ValidationException;
 import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.container.ContainerRequestFilter;
 import javax.ws.rs.ext.Provider;
 
 import org.apache.cxf.interceptor.InterceptorChain;
+import org.apache.cxf.logging.FaultListener;
+import org.apache.cxf.logging.NoOpFaultListener;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.validation.BeanValidationInInterceptor;
@@ -44,6 +49,17 @@ public class JAXRSBeanValidationInInterceptor extends BeanValidationInIntercepto
     }
     
     @Override
+    protected void handleValidation(final Message message, final Object resourceInstance,
+                                    final Method method, final List<Object> arguments)
{
+        try {
+            super.handleValidation(message, resourceInstance, method, arguments);
+        } catch (ValidationException ex) {
+            message.put(FaultListener.class.getName(), new NoOpFaultListener());
+            throw ex;
+        }
+    }
+    
+    @Override
     public void filter(ContainerRequestContext context) throws IOException {
         InterceptorChain chain = PhaseInterceptorChain.getCurrentMessage().getInterceptorChain();
         chain.add(this);    


Mime
View raw message