Hi all mates,
I'm currently using the guice integration module in a non-opensource
project and I just had a need that could become part of the framework,
I mean the interceptor should be able to re-throw the
ConstraintViolationException as a new Exception defined in the the
@Validate annotation, a possible use case could be in the JAX-RS
integration:

    @GET
    @Produces(MediaType.APPLICATION_XML)
    @Path("ip-country")
    @Validate(rethrowExceptionsAs = javax.ws.rs.WebApplicationException.class)
    public List<IpRange> getIpRangesByCountry(@NotEmpty @NotNull
            @QueryParam("countryCode")
            final List<String> countryCode) {
        ... do something
    }

What do you think about it? I've already done the same thing with
ibatis-guice integration and if you agree I'm able to provide it in a
while.
Many thanks in advance, have a nice day
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/

Reply via email to