Take the 2-minute tour ×

I have a RESTful web service. For implementation using JAX-RS (Jersey).

Have the following method:

public void foo (@PathParam ("name") String uuid) {

I need to do validation of input parameters. And if data invalid throw WebApplicationException.

I added my custom annotation CheckUuid (extends ):

public void foo (@PathParam ("name") @CheckUuid String uuid) {

Is it possible to do validation using annotations on a stage when the method chosen, but not yet called? For example using PreProcessInterceptor?

share|improve this question

2 Answers 2

Java EE6 has some built in validation functionality.


I have not used it however, but I saw it brought up during Java One and it looks pretty cool. I'm not sure at what point this would happen, but I think it might work out for you.

share|improve this answer
up vote 0 down vote accepted

As a result, it was decided to use the standard pattern in the method validation. Because in Jersey do not have PreProcessInterceptor.

share|improve this answer

Your Answer


