[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openejb-user
Subject:    Re: TomEE 7 bean validation
From:       Romain Manni-Bucau <rmannibucau () gmail ! com>
Date:       2015-12-21 18:33:40
Message-ID: CACLE=7OVsPUqLE4poomVn8Vp9YyggE9DcnVAesCd2463bo3FNQ () mail ! gmail ! com
[Download RAW message or body]


by default ValidationExceptionMapper but you can override it implementing
the same mapper and setting in system properties
org.apache.cxf.jaxrs.validation.ValidationExceptionMapper.activated=false


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-12-21 19:24 GMT+01:00 Steve Goldsmith <sgjava@gmail.com>:

> Very cool, that works with DTO:
> 
> 12/21/2015 13:13:33.577 [http-bio-57592-exec-1] DEBUG
> c.bhn.services.masblaster.OdnService - PostConstruct
> 12/21/2015 13:13:33.637 [http-bio-57592-exec-1] WARN
> o.a.c.j.v.ValidationExceptionMapper - OdnService.masVersion.arg0.transId:
> may not be null
> 12/21/2015 13:13:33.637 [http-bio-57592-exec-1] WARN
> o.a.c.j.v.ValidationExceptionMapper -
> OdnService.masVersion.arg0.customerGuid: may not be null
> 12/21/2015 13:13:33.637 [http-bio-57592-exec-1] WARN
> o.a.c.j.v.ValidationExceptionMapper - OdnService.masVersion.arg0.maxAgeMs:
> may not be null
> 12/21/2015 13:13:33.643 [http-bio-57592-exec-1] DEBUG
> c.b.s.m.ServerResponseLoggingFilter - Status: 400
> 12/21/2015 13:13:33.643 [http-bio-57592-exec-1] DEBUG
> c.b.s.m.ServerResponseLoggingFilter - Media type: null
> 12/21/2015 13:13:33.643 [http-bio-57592-exec-1] DEBUG
> c.b.s.m.ServerResponseLoggingFilter - Headers: {Date=[Mon, 21 Dec 2015
> 18:13:33 GMT]}
> 12/21/2015 13:13:33.643 [http-bio-57592-exec-1] DEBUG
> c.b.s.m.ServerResponseLoggingFilter - Entity: null
> 
> Now, is there a on exception hook in order to control response? I want to
> return the DTO with the warnings.
> 
> 
> On Mon, Dec 21, 2015 at 12:34 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> wrote:
> 
> > if your bean can be a CDI bean then it will be and benefit from bean
> > validation-cdi integration:
> > 
> > 
> > 
> https://github.com/rmannibucau/demo-jaxrs-bval/blob/master/src/main/java/com/github/rmannibucau/demo/jaxrsbval/ValidMyParams.java
> 
> > works as expected:
> > 
> > 
> https://github.com/rmannibucau/demo-jaxrs-bval/blob/master/src/main/java/com/github/rmannibucau/demo/jaxrsbval/ValidMyParams.java
> 
> > 
> > 
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com>
> > 
> > 2015-12-21 18:02 GMT+01:00 sgjava <sgjava@gmail.com>:
> > 
> > > I'm using simple DTOs that are sent from a REST client, where would CDI
> > > come
> > > into play in this scenario? There's no opportunity to @Inject them.
> > > 
> > > 
> > > 
> > > --
> > > View this message in context:
> > > 
> > 
> http://tomee-openejb.979440.n4.nabble.com/TomEE-7-bean-validation-tp4677232p4677278.html
> 
> > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > > 
> > 
> 
> 
> 
> --
> Steven P. Goldsmith
> 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic