Skip to content

Instantly share code, notes, and snippets.

@abhirockzz
Last active June 4, 2017 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhirockzz/76e7bf7a9326a34a06b5c0951f5a0e03 to your computer and use it in GitHub Desktop.
Save abhirockzz/76e7bf7a9326a34a06b5c0951f5a0e03 to your computer and use it in GitHub Desktop.
custom JAX-RS annotation decorated by @namebinding
@NameBinding
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface QueryParamValidator {
}
@Path("test")
public class TestResource {
@GET
@QueryParamValidator
public String test(@QueryParam("p") String p){
return "Param "+ p + " on " + new Date();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment