rest - Struggling with Bean Validation within a JAX RS running in a Glassfish Container -
i'm working on simple java ee application, using glassfish.
everything runs fine, entity , session beans working.
i created jax rs resources invoke session beans, works fine.
now i'm struggling bean validation.
let's have @ little snippet:
@get @path( "{portaluser}" ) @notnull public portaluserresponse load( @pathparam( "portaluser" ) @notblank @email final string stremail ) { ... implementation ... } my bailiwick of jersey application, of course of study extends resourceconfig looks this:
public jerseyapplication() { packages( portaluserservice.class.getpackage().getname() ); register( jacksonfeature.class ); register( validationconfig.class); property( serverproperties.bv_send_error_in_response, true ); } in pom.xml included next dependency:
<dependency> <groupid>org.glassfish.jersey.ext</groupid> <artifactid>jersey-bean-validation</artifactid> <version>2.9</version> </dependency> if invoke rest service nonsense data, validation doesn't kick in. why that? expect validation error.
i found jersey-sample covers bean validation stuff. rest-resource works within project. difference is, jersey-sample doesn't run in glassfish, in jetty.
can bailiwick of jersey bean validation doesn't work when running in java ee container?
would appreciate hints.
rest java-ee glassfish jax-rs bean-validation
No comments:
Post a Comment