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.
| Modifier and Type | Method and Description |
|---|---|
String[] |
getErrors()
Returns a list of "error spacifications", which may be error codes, FQCN of Exception classes or
special
4xx or 5xx values |
String |
getLocation()
URI mapping (must start with
/) that'll be used to handle the exception/error. |
getContextId, getContextSelectFilterString[] getErrors()
4xx or 5xx valuesString getLocation()
/) 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).Copyright © 2006–2024 OPS4J - Open Participation Software for Java. All rights reserved.