title: query parameter validation with Jersey
body: <p>I'm using Jersey in Java for a simple web server. I'm trying to handle with url query parameters, like</p>
  
  <pre><code>/path?value1=X&amp;value2=Y&amp;value3=Z
  </code></pre>
  
  <p>I was able to extract the query value by using the @QueryParam annotation like</p>
  
  <pre><code>@GET
  @Produces(MediaType.APPLICATION_XML)
  @Path("/path")
  public String getUpdate(@QueryParam("All") List&lt;String&gt; allParam, 
          @QueryParam(value = "value1") String value1, 
          @QueryParam(value = "value2") String value2, 
          @QueryParam(value = "value3") String value3) {
          ...
  }
  </code></pre>
  
  <p>Now my problem is I need to validate the input. I'm mainly trying to make sure that value1, value2 and value3 follow a specific format. I also want to make sure that those parameters are not empty.</p>
  
  <p>I checked out the Bean Validation documentation for Jersey, but it seemed hard to follow. This is probably because I'm still somewhat new to Jersey framework. </p>
  
  <p>So how can I set up query parameter validations? Are there easier to follow resources/examples I could be directed to? Thanks</p>