Class WebApplicationExceptionSilverpeasMapper

  • All Implemented Interfaces:
    javax.ws.rs.ext.ExceptionMapper<javax.ws.rs.WebApplicationException>

    @Provider
    @Priority(3000)
    public class WebApplicationExceptionSilverpeasMapper
    extends edu.psu.swe.commons.jaxrs.exceptions.mappers.WebApplicationExceptionMapper
    implements javax.ws.rs.ext.ExceptionMapper<javax.ws.rs.WebApplicationException>
    Customizes JAX-RS behaviour so that a WebApplicationException thrown with a cause and a response with no content is mapped to a response containing the exception message. A priority is given to the mapper in order to take precedence over the same type of mappers provided by any external libraries (id est commons-jaxrs). The priority isn't too high in order to give priority to any Silverpeas mapper of a WebApplicationException if any.
    • Constructor Detail

      • WebApplicationExceptionSilverpeasMapper

        public WebApplicationExceptionSilverpeasMapper()
    • Method Detail

      • toResponse

        public javax.ws.rs.core.Response toResponse​(javax.ws.rs.WebApplicationException exception)
        Specified by:
        toResponse in interface javax.ws.rs.ext.ExceptionMapper<javax.ws.rs.WebApplicationException>
        Overrides:
        toResponse in class edu.psu.swe.commons.jaxrs.exceptions.mappers.WebApplicationExceptionMapper