title: How to handle Service unavailable scenarios with Jersey REST
body: <p>I have a jersey RESTful service integraed with Spring.The base url mapped in web.xml is <code>/rest/*</code>
  My service class is below:</p>
  
  <pre><code>@Resource
  @Scope("request")
  @Path("/service/")
  @Component
  public class ServiceController {
  
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      public Response getApiDetails() {
          return Response.ok("area").build();
      }
  
      @Path("/area")
      @GET
      @Consumes({ MediaType.APPLICATION_JSON })
      @Produces(MediaType.APPLICATION_JSON)
      public Response processConvertCurrency(
          @QueryParam("length") String length,
          @QueryParam("breadth") String breadth) {
          ......
      }
  }
  </code></pre>
  
  <p>When the following url hit, it will show the available services</p>
  
  <pre><code>&lt;baseurl&gt;/rest/service
  
  output : area
  </code></pre>
  
  <p>Also <code>&lt;baseurl&gt;/rest/service/area?length=10&amp;breadth20</code> will return its output correctly.</p>
  
  <p>My requirement is that when someone hit <code>&lt;baseurl&gt;/rest/service/volume</code> it should output like</p>
  
  <pre><code>Service is unavailable message.
  </code></pre>
  
  <p>Since only <code>area</code> is available How can I do that.Please help..(currently 404 error is displayed)</p>