camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "fabrizio.spataro" <fabrizio.spat...@bizmate.it>
Subject Re: Customize the Http Response Code for REST Service
Date Fri, 25 Mar 2016 08:00:48 GMT
Hello,

I had same problem and i resolve it using "onException tag" to intercept
validation error and return another http response code

Example DSL:

<camelContext ...>
  <onException>
    <exception>java.your.exception</exception>
        <setHeader headerName="Exchange.HTTP_RESPONSE_CODE">
        	<constant>403</constant>
        </setHeader>
         <handled><constant>true</constant></handled>
   </onException>
.....
....
</camelContext>





--
View this message in context: http://camel.465427.n5.nabble.com/Customize-the-Http-Response-Code-for-REST-Service-tp5779682p5779691.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message