title: jersey @GET collection and @GET collection filtered by @QueryParam
body: <p>In my app users can register, that users can post workouts and comments on workouts.</p>
  
  <p>I design following resources and URIs:</p>
  
  <pre><code>USERS
  /users
  /users/{id}
  
  WORKOUTS
  /workouts
  /workouts/{id}
  
  COMMENTS
  /workouts{id}/comments
  /workouts{id}/comments/{id}
  </code></pre>
  
  <p>Since /workouts URI returns timeline, I tried to map user's workouts like /workouts?user=userId</p>
  
  <p>I don´t know how distinguish between get all collection and get collection filtered by @QueryParam, because:</p>
  
  <pre><code>@GET
  @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
  public Practicas getPracticas() {
      List&lt;Practica&gt; listaPracticas = practicaDao.getPracticas();
      Practicas practicas = new Practicas();
      practicas.setPracticas(listaPracticas);
      return practicas;
  }
  
  @GET
  @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
  public Practicas getPracticasUsuario(@QueryParam("idUsuario") int idUsuario) {
      List&lt;Practica&gt; listaPracticas = practicaDao.getPracticasByUser(idUsuario);
      Practicas practicas = new Practicas();
      practicas.setPracticas(listaPracticas);
      return practicas;
  }
  </code></pre>
  
  <p>throw following exception:</p>
  
  <pre><code>org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model has failed during application initialization.
  [[FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by @Consumes and @Produces annotations at Java methods public com.sporty.model.Practicas com.sporty.resource.PracticasResource.getPracticas() and public com.sporty.model.Practicas com.sporty.resource.PracticasResource.getPracticasUsuario(int) at matching regular expression /practicas. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1cc465f']
  </code></pre>
  
  <p>Is solution add another level on URI like /workouts/search?user=userId?</p>
  
  <p>Is a problem derived from a poor URI design?</p>
  
  <p>Thanks in advance</p>