Closed ops4j-issues closed 3 years ago
Pax Web 8 changes the tracking model entirely. Now the resource tracker looks like this:
@Override
protected ServletModel createElementModel(ServiceReference<Object> serviceReference, Integer rank, Long serviceId) {
log.debug("Creating resource model from R7 whiteboard service {} (id={})", serviceReference, serviceId);
// URL patterns
String[] urlPatterns = Utils.getPaxWebProperty(serviceReference,
null, HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN,
Utils::asStringArray);
// prefix
String path = Utils.getStringProperty(serviceReference, HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PREFIX);
if (path == null || "".equals(path.trim())) {
path = "/";
}
// pass everything to a handy builder - there's no servlet/servletSupplier/servletReference/servletClass
// provided, which will trigger a call to ServerController.createResourceServlet()
ServletModel.Builder builder = new ServletModel.Builder()
.withServiceRankAndId(rank, serviceId)
.withRegisteringBundle(serviceReference.getBundle())
.withUrlPatterns(urlPatterns)
.withLoadOnStartup(1)
.withAsyncSupported(true)
.withRawPath(path) // could be file: or a chroot inside a bundle - we'll check and validate later
.resourceServlet(true);
return builder.build();
}
Jean-Baptiste Onofre created PAXWEB-1272
When registering a resource like this:
only the first pattern is taken into account, second one is ignored.
Affects: 7.2.18 Fixed in: 7.3.12, 7.2.22 Votes: 0, Watches: 1