PrintWriter pw = response.getWriter();
if (bundleContext != null) {
ServiceReference sr = bundleContext.getServiceReference(HelloService.class.getName());
if (sr != null) {
HelloService sm = (HelloService) bundleContext.getService(sr);
pw.println(sm.sayHello());
bundleContext.ungetService(sr);
}
} else {
pw.println("Bundle Context is Null");
}