Search code examples
restjax-rsquarkusresteasy

How to use JAX-RS annotations for a custom REST method?


I would like to add a custom method search to a resource books (more about custom methods):

/books:search

I created a class:

public class BooksResource {

   @POST
   @Path("/books:search")
   public String search() {
      return "The best book";
   }

}

But, after invoking of /books:search I am getting a response code 404.

How could I annotate the BooksResource correctly?


Solution

  • You need to add @Path("") on your class as well