You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bval.apache.org by Simone Tripodi <si...@gmail.com> on 2010/06/28 15:53:28 UTC

Evolving the guice integration

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/

Re: Evolving the guice integration

Posted by Simone Tripodi <si...@gmail.com>.
Hi all guys,
since there are no objections, I'm going to implement that new feature.
Have a nice day!!!
Simo

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



On Mon, Jun 28, 2010 at 3:53 PM, Simone Tripodi
<si...@gmail.com> wrote:
> 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/
>