/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
.getContextHandler().getChildHandlerByClass(SecurityHandler.class))).getUserRealm();
((ConstraintsSecurityHandler)request.getContext().getContextHandler().getChildHandlerByClass(ConstraintsSecurityHandler.class)).getUserRealm(); if (realm.reauthenticate(principal))
return; String charset = _connection.getRequest().getContext().getContextHandler().getLocaleEncoding(locale);
public void init() _contextHandler=((ContextHandler.SContext)config).getContextHandler();
public void contextInitialized(ServletContextEvent sce) { SContext servletContext = (SContext) sce.getServletContext(); ContextHandler contextHandler = servletContext.getContextHandler(); Map initParams = contextHandler.getInitParams(); String configLocations = (String) initParams.get(ContextLoader.CONFIG_LOCATION_PARAM); if (configLocations != null) { configLocations = configLocations + " " + PLUTO_SERVICE_CONFIG_LOCATION; initParams.put(ContextLoader.CONFIG_LOCATION_PARAM, configLocations); } else { initParams.put(ContextLoader.CONFIG_LOCATION_PARAM, PLUTO_SERVICE_CONFIG_LOCATION); } // Traverse listeners to see if there's a configured // ContextLoaderListener EventListener[] listeners = contextHandler.getEventListeners(); if (listeners != null) { List newListenerList = new ArrayList(); for (int i = 0; i < listeners.length; i++) { EventListener listener = listeners[i]; if (!(listener instanceof ContextLoaderListener)) { newListenerList.add(listener); } } contextHandler.setEventListeners((EventListener[])newListenerList.toArray(new EventListener[newListenerList.size()])); } contextLoaderListener.contextInitialized(sce); }
protected static WebAppContext findWAC(ServletContext context) { if (context instanceof ContextHandler.SContext) { ContextHandler.SContext sContext = (ContextHandler.SContext) context; ContextHandler contextHandler = sContext.getContextHandler(); Handler handler = contextHandler.getHandler(); if (handler instanceof ServletHandler) { ServletHandler servletHandler = (ServletHandler) handler; Server server = servletHandler.getServer(); Handler serverHandler = server.getHandler(); if (serverHandler instanceof HandlerCollection) { HandlerCollection hc = (HandlerCollection) serverHandler; for (Handler h : hc.getHandlers()) { if (h instanceof WebAppContext) { WebAppContext wac = (WebAppContext) h; if (wac.getServletHandler() == servletHandler) { return wac; } } } } } } return null; } }
protected static WebAppContext findWAC(ServletContext context) { if (context instanceof ContextHandler.SContext) { ContextHandler.SContext sContext = (ContextHandler.SContext) context; ContextHandler contextHandler = sContext.getContextHandler(); Handler handler = contextHandler.getHandler(); if (handler instanceof ServletHandler) { ServletHandler servletHandler = (ServletHandler) handler; Server server = servletHandler.getServer(); Handler serverHandler = server.getHandler(); if (serverHandler instanceof HandlerCollection) { HandlerCollection hc = (HandlerCollection) serverHandler; for (Handler h : hc.getHandlers()) { if (h instanceof WebAppContext) { WebAppContext wac = (WebAppContext) h; if (wac.getServletHandler() == servletHandler) { return wac; } } } } } } return null; } }
protected static WebAppContext findWAC(ServletContext context) { if (context instanceof ContextHandler.SContext) { ContextHandler.SContext sContext = (ContextHandler.SContext) context; ContextHandler contextHandler = sContext.getContextHandler(); Handler handler = contextHandler.getHandler(); if (handler instanceof ServletHandler) { ServletHandler servletHandler = (ServletHandler) handler; Server server = servletHandler.getServer(); Handler serverHandler = server.getHandler(); if (serverHandler instanceof HandlerCollection) { HandlerCollection hc = (HandlerCollection) serverHandler; for (Handler h : hc.getHandlers()) { if (h instanceof WebAppContext) { WebAppContext wac = (WebAppContext) h; if (wac.getServletHandler() == servletHandler) { return wac; } } } } } } return null; } }
protected synchronized void doStart() throws Exception { _servletContext=ContextHandler.getCurrentContext(); _contextHandler=_servletContext==null?null:_servletContext.getContextHandler(); updateNameMappings(); updateMappings(); if(_filterChainsCached) _chainCache= new HashMap[]{null,new HashMap(),new HashMap(),null,new HashMap(),null,null,null,new HashMap()}; super.doStart(); if (_contextHandler==null || !(_contextHandler instanceof Context)) initialize(); }
/** * Infer the mime type for the response based on the extension of the * request URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); } }
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); } }
public void doStart() throws Exception { SContext scontext = ContextHandler.getCurrentContext(); _context = (scontext==null?null:scontext.getContextHandler()); super.doStart(); }
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
/** * Infer the mime type for the response based on the extension of the request * URI. Returns null if unknown. */ private String inferMimeType(ServletRequest request) { String path = ((HttpServletRequest)request).getRequestURI(); ContextHandler.SContext sContext = (ContextHandler.SContext)config.getServletContext(); MimeTypes mimes = sContext.getContextHandler().getMimeTypes(); Buffer mimeBuffer = mimes.getMimeByExtension(path); return (mimeBuffer == null) ? null : mimeBuffer.toString(); }
public static ContextHandler getCurrentWebAppContext() { ContextHandler.SContext context=ContextHandler.getCurrentContext(); if (context!=null) { ContextHandler handler = context.getContextHandler(); if (handler instanceof WebAppContext) return (ContextHandler)handler; } return null; }