# Class ContextPathCustomizer

java.lang.Object
org.eclipse.equinox.http.servlet.context.ContextPathCustomizer

public abstract class ContextPathCustomizer extends Object
A customizer that is called by the Http Whiteboard runtime in order to allow customization of context path used for servlets, resources and filters. There are two types of customizations that are allowed.

1. Control the default selection filter used when no "osgi.http.whiteboard.context.select" is specified.
2. Provide a prefix to the context path "osgi.http.whiteboard.context.path" specified by ServletContextHelper registrations.

Registering a customizer results in re-initializing all existing ServletContextHelper registrations. This should not be done often. Only the highest ranked customizer is used the runtime.

Note: This class is part of an interim SPI that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this SPI will almost certainly be broken (repeatedly) as the SPI evolves.

Since:
  1.2

## Constructor Summary

Constructors
Constructor
Description
`ContextPathCustomizer()`

## Method Summary

Modifier and Type
Method
Description
`String`
`getContextPathPrefix(ServiceReference<ServletContextHelper> helper)`
Returns a prefix that is prepended to the context path value specified by the supplied helper's "osgi.http.whiteboard.context.path" service property.
`String`
`getDefaultContextSelectFilter(ServiceReference<?> httpWhiteBoardService)`
Returns a service filter that is used to select the default ServletContextHelper when no selection filter is specified by the whiteboard service.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ContextPathCustomizer

public ContextPathCustomizer()

## Method Details

### getDefaultContextSelectFilter

public String getDefaultContextSelectFilter(ServiceReference<?> httpWhiteBoardService)
Returns a service filter that is used to select the default ServletContextHelper when no selection filter is specified by the whiteboard service. This method is only called if the supplied whiteboard service does not provide the "osgi.http.whiteboard.context.select" service property.

Returns:
  a service filter that is used to select the default SErvletContextHelper for the specified whiteboard service.

### getContextPathPrefix

public String getContextPathPrefix(ServiceReference<ServletContextHelper> helper)
Returns a prefix that is prepended to the context path value specified by the supplied helper's "osgi.http.whiteboard.context.path" service property.

Parameters:
  `helper` - the helper for which the context path will be prepended to
Returns:
  the prefix to prepend to the context path