@Override protected void setFilterChainFactory(FilterChainFactory filterChainFactory) { super.setFilterChainFactory(filterChainFactory); }
/** * {@inheritDoc} */ @Override public void start() { try { configureServletEnv(); } catch (Throwable t) { LOGGER.log(Level.SEVERE, "start", t); } }
ClassLoader contextClassLoader = wrapper.getClassLoader(); if (contextClassLoader != null) { oldCCL = Thread.currentThread().getContextClassLoader(); wrapper.doServletService(request, response, state.dispatcherType); } finally {
final ServletHandler servletHandler = new ServletHandler(sConfig); servletHandler.setServletInstance(registration.servlet); servletHandler.setServletClass(registration.servletClass); servletHandler.setServletClassName(registration.className); servletHandler.setContextPath(contextPath); servletHandler.setFilterChainFactory(filterChainFactory); servletHandler.setExpectationHandler(registration.expectationHandler); servletHandler.addOnDestroyListener(onDestroyListener);
customizeErrorPage(response, "Resource Not Found", 404, null); return; final HttpServletResponseImpl servletResponse = HttpServletResponseImpl.create(); setPathData(request, servletRequest); servletRequest.initialize(request, servletResponse, servletCtx); servletResponse.initialize(response, servletRequest); loadServlet(); setDispatcherPath(request, getCombinedPath(servletRequest)); FilterChainInvoker filterChain = getFilterChain(request); if (filterChain != null) { filterChain.invokeFilterChain(servletRequest, servletResponse); } catch (Throwable ex) { LOGGER.log(Level.SEVERE, "service exception:", ex); customizeErrorPage(response, "Internal Error", 500, ex);
crossContext = !(wrapper.getContextPath().equals(contextPath)); wrapper.getServletCtx(), crossContext, state.dispatcherType);
dtInfo.addDispatchTarget(wrapper.getName(), true); } else { dtInfo.addDispatchTarget(getCombinedPath(), false); String targetContextPath = wrapper.getContextPath();
/** * * @param handler * @param mapping * @return */ private static String updateMappings(ServletHandler handler, String mapping) { String mappingLocal = mapping; if (mappingLocal.length() == 0) { mappingLocal = "/"; } else { if (mappingLocal.charAt(0) == '*') { mappingLocal = "/" + mapping; } if (mappingLocal.indexOf("//", 1) != -1) { mappingLocal = mappingLocal.replaceAll("//", "/"); } } String contextPath = handler.getContextPath(); contextPath = ((contextPath.length() == 0) ? "/" : contextPath); return (contextPath + mappingLocal); }
/** * {@inheritDoc} */ @Override public void service(Request request, Response response) throws Exception { if (classLoader != null) { final ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(classLoader); try { doServletService(request, response); } finally { Thread.currentThread().setContextClassLoader(prevClassLoader); } } else { doServletService(request, response); } }
final ServletHandler servletHandler = new ServletHandler(sConfig); servletHandler.setServletInstance(registration.servlet); servletHandler.setServletClass(registration.servletClass); servletHandler.setServletClassName(registration.className); servletHandler.setContextPath(contextPath); servletHandler.setFilterChainFactory(filterChainFactory); servletHandler.setExpectationHandler(registration.expectationHandler); servletHandler.addOnDestroyListener(onDestroyListener);
customizeErrorPage(response, "Resource Not Found", 404, null); return; final HttpServletResponseImpl servletResponse = HttpServletResponseImpl.create(); setPathData(request, servletRequest); servletRequest.initialize(request, servletResponse, servletCtx); servletResponse.initialize(response, servletRequest); loadServlet(); setDispatcherPath(request, getCombinedPath(servletRequest)); FilterChainInvoker filterChain = getFilterChain(request); if (filterChain != null) { filterChain.invokeFilterChain(servletRequest, servletResponse); } catch (Throwable ex) { LOGGER.log(Level.SEVERE, "service exception:", ex); customizeErrorPage(response, "Internal Error", 500, ex);
crossContext = !(wrapper.getContextPath().equals(contextPath)); wrapper.getServletCtx(), crossContext, state.dispatcherType);
dtInfo.addDispatchTarget(wrapper.getName(), true); } else { dtInfo.addDispatchTarget(getCombinedPath(), false); String targetContextPath = wrapper.getContextPath();
/** * * @param handler * @param mapping * @return */ private static String updateMappings(ServletHandler handler, String mapping) { String mappingLocal = mapping; if (mappingLocal.length() == 0) { mappingLocal = "/"; } else { if (mappingLocal.charAt(0) == '*') { mappingLocal = "/" + mapping; } if (mappingLocal.indexOf("//", 1) != -1) { mappingLocal = mappingLocal.replaceAll("//", "/"); } } String contextPath = handler.getContextPath(); contextPath = ((contextPath.length() == 0) ? "/" : contextPath); return (contextPath + mappingLocal); }
/** * {@inheritDoc} */ @Override public void service(Request request, Response response) throws Exception { if (classLoader != null) { final ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(classLoader); try { doServletService(request, response); } finally { Thread.currentThread().setContextClassLoader(prevClassLoader); } } else { doServletService(request, response); } }
final ServletHandler servletHandler = new ServletHandler(sConfig); servletHandler.setServletInstance(registration.servlet); servletHandler.setServletClass(registration.servletClass); servletHandler.setServletClassName(registration.className); servletHandler.setContextPath(contextPath); servletHandler.setFilterChainFactory(filterChainFactory); servletHandler.setExpectationHandler(registration.expectationHandler); servletHandler.addOnDestroyListener(onDestroyListener);
customizeErrorPage(response, "Resource Not Found", 404, null); return; final HttpServletResponseImpl servletResponse = HttpServletResponseImpl.create(); setPathData(request, servletRequest); servletRequest.initialize(request, servletResponse, servletCtx); servletResponse.initialize(response, servletRequest); loadServlet(); setDispatcherPath(request, getCombinedPath(servletRequest)); FilterChainInvoker filterChain = getFilterChain(request); if (filterChain != null) { filterChain.invokeFilterChain(servletRequest, servletResponse); } catch (Throwable ex) { LOGGER.log(Level.SEVERE, "service exception:", ex); customizeErrorPage(response, "Internal Error", 500, ex);
ClassLoader contextClassLoader = wrapper.getClassLoader(); if (contextClassLoader != null) { oldCCL = Thread.currentThread().getContextClassLoader(); wrapper.doServletService(request, response, state.dispatcherType); } finally {
crossContext = !(wrapper.getContextPath().equals(contextPath)); wrapper.getServletCtx(), crossContext, state.dispatcherType);
dtInfo.addDispatchTarget(wrapper.getName(), true); } else { dtInfo.addDispatchTarget(getCombinedPath(), false); String targetContextPath = wrapper.getContextPath();