Interface ErrorPageMapping

  • All Superinterfaces:
    ContextRelated

    public interface ErrorPageMapping
    extends ContextRelated

    Registers an error page to customize the response sent back to the web client in case that an exception or error propagates back to the web container, or the servlet/filter calls sendError() on the response object for a specific status code.

    This is Pax Web specific Whiteboard mapping approach, where all the details are passed directly and not as service registration properties. The problem with CMPN Whitboard specification is that error pages are not registered directly, but as service registration properties when registering a Servlet. Also, such servlet is not required to be associated with any URL pattern. Pax Web on the other hand matches the web.xml model, where error page is a mapping from error codes/exception names to an URI (not a Servlet). Thus in Pax Web we're forced to use artificial, generated URI locations. With mapping approach, error mapping is registered together with some servlet with can always be accessed directly (just as in web.xml.

    Since:
    0.7.0 Jun 23, 2009
    Author:
    dsklyut
    • Method Detail

      • getErrors

        String[] getErrors()
        Returns a list of "error spacifications", which may be error codes, FQCN of Exception classes or special 4xx or 5xx values
        Returns:
      • getLocation

        String getLocation()
        URI mapping (must start with /) that'll be used to handle the exception/error. In case of standard OSGi CMPN Whiteboard specification, the location is passed implicitly - the associated Servlet being registered will handle the problem. In Pax Web Whiteboard mapping, actual servlet should be registered separately (by registering a Servlet or ServletMapping).
        Returns: