String ctxPathConfigured = fwkAgent
.getOSGiSysConfigProperty("webosgi.contextPath");
if (host != null && host.trim().length() > 0) {
// Check if servletContext.getContextPath() is available if
// Servlet 2.5. It true, override the configured context path.
ServletContextAdapter fwkServletCtxAdapter = fwkAgent
.getFwkServletContext(FwkExternalAgent.SERVLET_TYPE_HTTP);
String ctxPathFromServlet = fwkServletCtxAdapter
.getContextPath();
final String ctxPath = ctxPathFromServlet != null ? ctxPathFromServlet
: (ctxPathConfigured != null ? ctxPathConfigured.trim()
: "");
new Thread(new Runnable() {