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 theweb.xml
model, where error page is a mapping from error codes/exception names to an URI (not aServlet
). 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 inweb.xml
.- Since:
- 0.7.0 Jun 23, 2009
- Author:
- dsklyut
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String[]
getErrors()
Returns a list of "error spacifications", which may be error codes, FQCN of Exception classes or special4xx
or5xx
valuesString
getLocation()
URI mapping (must start with/
) that'll be used to handle the exception/error.-
Methods inherited from interface org.ops4j.pax.web.service.whiteboard.ContextRelated
getContextId, getContextSelectFilter
-
-
-
-
Method Detail
-
getErrors
String[] getErrors()
Returns a list of "error spacifications", which may be error codes, FQCN of Exception classes or special4xx
or5xx
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 associatedServlet
being registered will handle the problem. In Pax Web Whiteboard mapping, actual servlet should be registered separately (by registering aServlet
orServletMapping
).- Returns:
-
-