@Test public void shouldAddRootRequestHandler() throws Exception { jetty9Server.configure(); jetty9Server.startHandlers(); ContextHandler rootRequestHandler = getLoadedHandlers().get(GoServerLoadingIndicationHandler.class); assertThat(rootRequestHandler.getContextPath(), is("/")); }
@Test public void shouldAddResourceHandlerForAssets() throws Exception { jetty9Server.configure(); jetty9Server.startHandlers(); ContextHandler assetsContextHandler = getLoadedHandlers().get(AssetsContextHandler.class); assertThat(assetsContextHandler.getContextPath(), is("context/assets")); }
/** * The context path {@link App} relating to how it is installed on the * jetty server side. * * @return the contextPath for the App */ public String getContextPath() { if (this._context == null) { return null; } return this._context.getContextPath(); }
Set<String> getContextPaths() { Set<String> set = new HashSet<String>(); for (ContextHandler context:_contexts) set.add(context.getContextPath()); return set; }
public String getAddress(Object serverContext) { if (ContextHandler.class.isAssignableFrom(serverContext.getClass())) { return ((ContextHandler)serverContext).getContextPath(); } else { return null; } } }
Set<String> getContextPaths() { Set<String> set = new HashSet<String>(); for (ContextHandler context:_contexts) set.add(context.getContextPath()); return set; }
Set<String> getContextPaths() { Set<String> set = new HashSet<String>(); for (ContextHandler context:_contexts) set.add(context.getContextPath()); return set; }
@Override public String getServletContextName() { String name = ContextHandler.this.getDisplayName(); if (name == null) name = ContextHandler.this.getContextPath(); return name; }
private String getHandlerName(URL url, ContextHandler context) { String contextPath = context.getContextPath(); String path = url.getPath(); if (path.startsWith(contextPath)) { if ("/".equals(contextPath)) { return path; } return path.substring(contextPath.length()); } else { return HttpUriMapper.getResourceBase(url.getPath()); } }
@Override public String getServletContextName() { String name = ContextHandler.this.getDisplayName(); if (name == null) name = ContextHandler.this.getContextPath(); return name; }
private String getHandlerName(URL url, ContextHandler context) { String contextPath = context.getContextPath(); String path = url.getPath(); if (path.startsWith(contextPath)) { if ("/".equals(contextPath)) { return path; } return path.substring(contextPath.length()); } else { return HttpUriMapper.getResourceBase(url.getPath()); } }
@Override public String getServletContextName() { String name = ContextHandler.this.getDisplayName(); if (name == null) name = ContextHandler.this.getContextPath(); return name; }
@Override public String getServletContextName() { String name = ContextHandler.this.getDisplayName(); if (name == null) name = ContextHandler.this.getContextPath(); return name; }
@Override public String getServletContextName() { String name = ContextHandler.this.getDisplayName(); if (name == null) name = ContextHandler.this.getContextPath(); return name; }
@Override public String getServletContextName() { String name = ContextHandler.this.getDisplayName(); if (name == null) name = ContextHandler.this.getContextPath(); return name; }
@Override public String getServletContextName() { String name = ContextHandler.this.getDisplayName(); if (name == null) name = ContextHandler.this.getContextPath(); return name; }
@Override public String getServletContextName() { String name = ContextHandler.this.getDisplayName(); if (name == null) name = ContextHandler.this.getContextPath(); return name; }
@Override public String getServletContextName() { String name = ContextHandler.this.getDisplayName(); if (name == null) name = ContextHandler.this.getContextPath(); return name; }
@Override public String getServletContextName() { String name = ContextHandler.this.getDisplayName(); if (name == null) name = ContextHandler.this.getContextPath(); return name; }
public void addHandler(final Domain domain) { ContextHandler handler = domainHandlerFactory.create(domain); try { parent.addHandler(handler); // Do not remove next line, handler should be managed to join group lifecycle when server // is already in STARTED state parent.manage(handler); handler.start(); logger.info("Security domain {} has been been published on path {}", domain.getName(), handler.getContextPath()); } catch (Exception ex) { logger.error("Unable to add a new handler", ex); } }