private void setContextAttributes(Context context, Configuration conf) { context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf); context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl); }
private void setContextAttributes(Context context, Configuration conf) { context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf); context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl); }
private void setContextAttributes(Context context, Configuration conf) { context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf); context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl); }
private void setContextAttributes(Context context, Configuration conf) { context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf); context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl); }
private void setContextAttributes(Context context, Configuration conf) { context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf); context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl); }
private void setContextAttributes(Context context, Configuration conf) { context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf); context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl); }
private void setContextAttributes(Context context, Configuration conf) { context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf); context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl); }
private void setContextAttributes(Context context) { context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf); context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl); }
/** * Performs initialization of the web context binding it to Jetty. * * @throws Exception * in case of an error while starting the Jetty context */ @PostConstruct public void postConstruct() throws Exception { ServletContext servletContext = jettyContext.getServletContext(); GenericWebApplicationContext webCtx = new GenericWebApplicationContext(); webCtx.setServletContext(servletContext); webCtx.setParent(ctx); webCtx.refresh(); servletContext.setAttribute(contextAttribute, webCtx); jettyContext.start(); if (log.isInfoEnabled()) { log.info("| Jetty Web Application Context started!"); } }
protected void initServer() throws Exception { LOG.info("Initializing Jetty server..."); ServletHolder sh = new ServletHolder(ServletContainer.class); sh.setInitParameter(ServletContainer.RESOURCE_CONFIG_CLASS, PackagesResourceConfig.class.getName()); sh.setInitParameter(PackagesResourceConfig.PROPERTY_PACKAGES, getPackages()); sh.setServlet(new SpringServlet()); server = new Server(getPort()); Context context = new Context(server, getBasePath(), Context.SESSIONS); Map<String, String> params = new HashMap<String, String>(); params.put(ContextLoaderListener.CONFIG_LOCATION_PARAM, getSpringContextLocation()); context.setInitParams(params); context.addEventListener(new ContextLoaderListener()); context.addEventListener(new RequestContextListener()); context.addServlet(sh, getServletMapping()); server.start(); LOG.info("Jetty server running."); this.applicationContext = WebApplicationContextUtils.getWebApplicationContext(context.getServletContext()); }
protected void initServer() throws Exception { LOG.info("Initializing Jetty server..."); ServletHolder sh = new ServletHolder(ServletContainer.class); sh.setInitParameter(ServletContainer.RESOURCE_CONFIG_CLASS, PackagesResourceConfig.class.getName()); sh.setInitParameter(PackagesResourceConfig.PROPERTY_PACKAGES, getPackages()); sh.setServlet(new SpringServlet()); server = new Server(getPort()); Context context = new Context(server, getBasePath(), Context.SESSIONS); Map<String, String> params = new HashMap<String, String>(); params.put(ContextLoaderListener.CONFIG_LOCATION_PARAM, getSpringContextLocation()); context.setInitParams(params); context.addEventListener(new ContextLoaderListener()); context.addEventListener(new RequestContextListener()); context.addServlet(sh, getServletMapping()); server.start(); LOG.info("Jetty server running."); applicationContext = WebApplicationContextUtils.getWebApplicationContext(context.getServletContext()); }
@Override protected void setUp() throws Exception { super.setUp(); server = new Server(); server.setHandler(new WebAppContext("/noroot", "")); final Context context = new Context(server, getContextPath(), Context.SESSIONS); configure(context); server.setHandler(context); SocketConnector connector = new SocketConnector(); server.addConnector(connector); server.start(); url = new URL("http://localhost:"+connector.getLocalPort()+getContextPath()+"/"); servletContext = context.getServletContext(); webApp = WebApp.get(servletContext); // export the test object as the root as a reasonable default. webApp.setApp(this); }
Node.getInstance().addServletContext(url.getPort(), context.getServletContext());
ServletManager.getInstance().addServletContext(url.getPort(), context.getServletContext());
ServletManager.getInstance().addServletContext(url.getPort(), context.getServletContext());
ServletManager.getInstance().addServletContext(url.getParameter(Constants.BIND_PORT_KEY, url.getPort()), context.getServletContext());
ServletManager.getInstance().addServletContext(url.getParameter(Constants.BIND_PORT_KEY, url.getPort()), context.getServletContext());