-buildpath: \
lib/*.jar;version=file
Include-Resource: \
static/angular;type=dir;resource:=webresource/angular
import org.osgi.service.http.HttpService;
import org.osgi.service.http.NamespaceException;
import org.osgi.service.http.Resource;
import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
@Component(property = { HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PREFIX + "=/angular",
HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN + "=/angular/*" })
public class WebResourceServlet {
@Reference
private HttpService httpService;
@Activate
public void activate() {
try {
httpService.registerResources("/angular", "/angular", null);
} catch (NamespaceException e) {
// Handle exception
}
}
@Deactivate
public void deactivate() {
httpService.unregister("/angular");
}
}