HttpContext commonContext =
new CarbonSecuredHttpContext(context.getBundle(), "/web", uiResourceRegistry, registry);
//Registering filedownload servlet
Servlet fileDownloadServlet = new ContextPathServletAdaptor(new FileDownloadServlet(
context, getConfigurationContextService()), "/filedownload");
httpService.registerServlet("/filedownload", fileDownloadServlet, null, commonContext);
fileDownloadServlet.getServletConfig().getServletContext().setAttribute(
CarbonConstants.SERVER_URL, serverURL);
fileDownloadServlet.getServletConfig().getServletContext().setAttribute(
CarbonConstants.INDEX_PAGE_URL, indexPageURL);
//Registering fileupload servlet
Servlet fileUploadServlet;
if (isLocalTransportMode) {
fileUploadServlet = new ContextPathServletAdaptor(new FileUploadServlet(
context, serverConfigContext, webContext), "/fileupload");
} else {
fileUploadServlet = new ContextPathServletAdaptor(new FileUploadServlet(
context, clientConfigContext, webContext), "/fileupload");
}
httpService.registerServlet("/fileupload", fileUploadServlet, null, commonContext);
fileUploadServlet.getServletConfig().getServletContext().setAttribute(
CarbonConstants.SERVER_URL, serverURL);
fileUploadServlet.getServletConfig().getServletContext().setAttribute(
CarbonConstants.INDEX_PAGE_URL, indexPageURL);
uiBundleDeployer.deploy(bundleContext, commonContext);
context.addBundleListener(uiBundleDeployer);
httpService.registerServlet("/", new org.apache.tiles.web.startup.TilesServlet(),
initparams,
commonContext);
httpService.registerResources("/" + webContext, "/", commonContext);
adaptedJspServlet = new ContextPathServletAdaptor(
new TilesJspServlet(context.getBundle(), uiResourceRegistry), "/" + webContext);
httpService.registerServlet("/" + webContext + "/*.jsp", adaptedJspServlet, null,
commonContext);
ServletContext jspServletContext =