title: Passing indefinite Query Parameters with RESTful URL and reading them in RESTEasy
body: <p>I have a requirement to design a RESTful Service using RESTEasy. Clients can call this common service with any number of Query Parameters they would want to. My REST code should be able to read these Query Params in some way. For example if I have a book search service, clients can make the following calls.</p>
  
  <pre><code>http://domain.com/context/rest/books/searchBook?bookName=someBookName
  http://domain.com/context/rest/books/searchBook?authorName=someAuthor&amp; pubName=somePublisher
  http://domain.com/context/rest/books/searchBook?isbn=213243
  http://domain.com/context/rest/books/searchBook?authorName=someAuthor
  </code></pre>
  
  <p>I have to write a service class like below to handle this.</p>
  
  <pre><code>@Path("/books")
     public class BookRestService{
  
      // this is what I currently have, I want to change this method to in-take all the 
      // dynamic parameters that can come
      @GET
      @Path("/searchBook")
      public Response searchBook(@QueryParam("bookName") String bookName,@QueryParam("isbn") String isbn) {
  
       // fetch all such params
       // create a search array and pass to backend
  
      }
  
      @POST
      @Path("/addBook")
      public Response addBook(......) {
      //....
       }
      }
  </code></pre>
  
  <p>Sorry for the bad format (I couldn't get how code formatting works in this editor!). As you can see, I need to change the method searchBook() so that it will take any number of query parameters. </p>
  
  <p>I saw a similar post here, but couldn't find the right solution.</p>
  
  <p><a href="https://stackoverflow.com/questions/2323840/how-to-design-a-restful-url-for-search-with-optional-paramaters/2324628#2324628">How to design a RESTful URL for search with optional parameters?</a></p>
  
  <p>Could any one throw some light on this please?</p>