title: URI-specific ExceptionMapper in JAX-RS
body: <p>I'm using Jersey, and Guice as my IOC-container. I'd like to know if it is possible to associate an ExceptionMapper with a specific URI. The reason for this is that I want to map the same exception differently based on what URI was visited. For example, suppose I've got the following two exception mappers for my custom exception:</p>
  
  <pre><code>public class MyExceptionMapperForFirstURI implements
    ExceptionMapper&lt;MyException&gt; {..return response based on first URI..}
  
  public class MyExceptionMapperForSecondURI implements
    ExceptionMapper&lt;MyException&gt; {..return response based on second URI..}
  </code></pre>
  
  <p>As far as I understand you bind an ExceptionMapper in your ServletModule as follows:</p>
  
  <pre><code>public class MyModule extends ServletModule {
  
      @Override
      public void configureServlets() {
          super.configureServlets();
          bind(MyCustomExceptionMapper.class);
      }
  }
  </code></pre>
  
  <p>How would I go about binding <code>MyExceptionMapperForFirstURI</code> and <code>MyExceptionMapperForSecondURI</code> so that they get associated with the correct URIs. Is this possible, and if possible: is this the correct way to do this?</p>