Add Jetty's {@code JspServlet} to the given {@link WebAppContext}.
@param context the jetty {@link WebAppContext}
325401
protected final void addJspServlet(WebAppContext context) {
		Assert.notNull(context, "Context must not be null");
		ServletHolder holder = new ServletHolder();
		holder.setName("jsp");
		holder.setClassName(getJsp().getClassName());
		holder.setInitParameter("fork", "false");
		holder.setInitParameters(getJsp().getInitParameters());
		holder.setInitOrder(3);
		context.getServletHandler().addServlet(holder);
		ServletMapping mapping = new ServletMapping();
		mapping.setServletName("jsp");
		mapping.setPathSpecs(new String[] { "*.jsp", "*.jspx" });
		context.getServletHandler().addServletMapping(mapping);
	}
959209
public synchronized void startup(AppContextWrapper context) {
		ContainerRegistryBuilder cb;
		try {
			cb = (ContainerRegistryBuilder) context.getAttribute(ContainerRegistryBuilder.APPLICATION_CONTEXT_ATTRIBUTE_NAME);
			if (cb == null) {
				Debug.logError("[JdonFramework] at first call prepare method");
				return;
			}
			if (cb.isKernelStartup())
				return;
			ContainerDirector cd = new ContainerDirector(cb);
			cd.startup();
		} catch (Exception ex) {
			Debug.logError(ex, module);
		}
	}
589798
public void addContextParam(final WebAppInitParam contextParam) {
		NullArgumentException.validateNotNull(contextParam, "Context param");
		NullArgumentException.validateNotNull(contextParam.getParamName(),
				"Context param name");
		NullArgumentException.validateNotNull(contextParam.getParamValue(),
				"Context param value");
		contextParams.add(contextParam);
	}
1229583
protected void createSessionContext(DeployedModule moduleConfig) throws Throwable {
        try {
            // added sessionIdListeners for Servlet 3.1
            ArrayList sessionRelatedListeners[] = new ArrayList[] { sessionListeners, sessionAttrListeners, sessionIdListeners }; // cmd
            // PQ81253
            this.sessionCtx = ((WebGroup) parent).getSessionContext(moduleConfig, this, sessionRelatedListeners); // cmd
            // PQ81253
        } catch (Throwable th) {
            // pk435011
            logger.logp(Level.SEVERE, CLASS_NAME, "createSessionContext", "error.obtaining.session.context", th);
            throw new WebAppNotLoadedException(th.getMessage());
        }

    }
599139
@SuppressWarnings("unchecked")
	public void addBeanContextServicesListener(BeanContextServicesListener listener)
	{
		if (listener == null)
		{
			throw new NullPointerException();
		}
		synchronized (bcsListeners)
		{
			bcsListeners.add(listener);
		}
	}
147377
private static void initURLTemplates( ServletContext servletContext )
    {
        TemplatedURLFormatter formatter = TemplatedURLFormatter.getTemplatedURLFormatter( servletContext );
        if ( formatter == null )
        {
            // get the default template formatter class name from the config file
            formatter = getTemplatedURLFormatter();

            assert formatter != null : "Found a non-null URL formatter";

            // set the TemplatedURLFormatter attribute on the context.
            TemplatedURLFormatter.initServletContext( servletContext, formatter );
        }

        URLTemplatesFactory templatesFactory = URLTemplatesFactory.getURLTemplatesFactory( servletContext );
        if ( templatesFactory == null )
        {
            // URLTemplatesFactory has not been initialized,
            // get a URLTemplatesFactory object from the containerAdapter.
            templatesFactory = PageFlowUtils.createURLTemplatesFactory( servletContext );

            // get the known/req tokens from the default formatter for the factory to use to verify templates
            templatesFactory.setKnownTokens( formatter.getKnownTokens() );
            templatesFactory.setRequiredTokens( formatter.getRequiredTokens() );
            templatesFactory.load( servletContext );

            // set the URLTemplatesFactory attribute on the context.
            URLTemplatesFactory.initServletContext( servletContext, templatesFactory );
        }
    }
39893
public void attach(BuildContext context) {
        this.source.addObjectSink(this);

        Class<?> nodeTypeClass = objectType.getClassType();
        if (nodeTypeClass == null) {
            return;
        }

        EntryPointNode epn = context.getKnowledgeBase().getRete().getEntryPointNode( ((EntryPointNode) source).getEntryPoint() );
        if (epn == null) {
            return;
        }

        ObjectTypeConf objectTypeConf = epn.getTypeConfReg().getObjectTypeConfByClass( nodeTypeClass );
        if ( objectTypeConf != null ) {
            objectTypeConf.resetCache();
        }
    }
440266
protected void setupClasspathJarResourceIfNeeds(WebAppContext context) {
        if (isWarableWorld() || !isValidMetaInfConfiguration()) {
            return;
        }
        // may be local development and uses meta-inf configuration here
        final List<String> classpathList = extractJarClassspathList();
        for (String classpath : classpathList) {
            final String jarPath = convertClasspathToJarPath(classpath);
            final URL url;
            try {
                url = new URL(jarPath);
            } catch (MalformedURLException e) {
                throw new IllegalStateException("Failed to create URL from the jar path: " + jarPath, e);
            }
            context.getMetaData().addContainerResource(new JarResource(url) {
            });
        }
    }
1187090
protected void createWebAppContext() {
    webapp = new WebAppContext();
    webapp.setThrowUnavailableOnStartupException(true);
    webapp.setServerClasses(getServerClasses());
    webapp.setContextPath(getContextPath());
    webapp.setTempDirectory(createTempDir("jetty-app-"));
    setSecureCookies();
  }
239853
public void contextInitialized(ServletContextEvent event) {
        this.context = event.getServletContext();

        // Output a simple message to the server's console
        System.out.println("The Simple Web App. Is Ready");

        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                "/client.xml");
        LocatorService client = (LocatorService) context
                .getBean("locatorService");

        String serviceHost = this.context.getInitParameter("serviceHost");

        try {
            client.registerEndpoint(new QName(
                    "http://talend.org/esb/examples/", "GreeterService"),
                    serviceHost, BindingType.SOAP_11, TransportType.HTTP, null);
        } catch (InterruptedExceptionFault e) {
            e.printStackTrace();
        } catch (ServiceLocatorFault e) {
            e.printStackTrace();
        }
    }
314239
@com.fasterxml.jackson.annotation.JsonProperty("Context")
    public void setContext(String context) {
        this.context = context;
    }
241006
@SuppressWarnings("rawtypes")
	public List<ServletDefinition> initJawrSpringServlets(ServletContext servletContext) throws ServletException{
		
		List<ServletDefinition> jawrServletDefinitions = new ArrayList<ServletDefinition>();
		ContextLoader contextLoader = new ContextLoader();
		WebApplicationContext applicationCtx = contextLoader.initWebApplicationContext(servletContext);
		Map<?, ?> jawrControllersMap = applicationCtx.getBeansOfType(JawrSpringController.class);
		
		Iterator<?> entrySetIterator = jawrControllersMap.entrySet().iterator();
		while(entrySetIterator.hasNext()){
			
			JawrSpringController jawrController = (JawrSpringController) ((Map.Entry) entrySetIterator.next()).getValue();
			Map<String, Object> initParams = new HashMap<String, Object>();
			initParams.putAll(jawrController.getInitParams());
			ServletConfig servletConfig = new MockServletConfig(SPRING_DISPATCHER_SERVLET,servletContext, initParams);
			MockJawrSpringServlet servlet = new MockJawrSpringServlet(jawrController, servletConfig);
			ServletDefinition servletDefinition = new ServletDefinition(servlet, servletConfig) ;
			jawrServletDefinitions.add(servletDefinition);
		}
		
		contextLoader.closeWebApplicationContext(servletContext);
		return jawrServletDefinitions;
	}
1203849
@Override
	protected void initServletContext(ServletContext servletContext) {
		super.initServletContext(servletContext);
		super.setExposeRequestAttributes(true);
		
		initBaseTemplatePath(servletContext);
		initSharedFunction();
	}
936161
public void addServlet(Servlet servlet, String uri) {
        // create a holder and then add it to the mapping
        ServletHolder servletHolder = new ServletHolder(servlet);
        rootServletContext.addServlet(servletHolder, uri);
    }
718488
public WebAppContext addWarApp(String war, String contextPath) throws JettyBootstrapException {
        WarAppJettyHandler warAppJettyHandler = new WarAppJettyHandler(getInitializedConfiguration());
        warAppJettyHandler.setWar(war);
        warAppJettyHandler.setContextPath(contextPath);

        WebAppContext webAppContext = warAppJettyHandler.getHandler();
        handlers.addHandler(webAppContext);

        return webAppContext;
    }
431251
public static <T> T registerBeanIntoApplicationContext(final ConfigurableApplicationContext applicationContext,
                                                           final Class<T> beanClazz, final String beanId) {
        val beanFactory = applicationContext.getBeanFactory();
        val provider = beanFactory.createBean(beanClazz);
        beanFactory.initializeBean(provider, beanId);
        beanFactory.autowireBean(provider);
        beanFactory.registerSingleton(beanId, provider);
        return provider;
    }
1344664
public static ActionServlet getActionServlet( ServletContext context )
    {
        if ( context == null ) return null;
        return ( ActionServlet ) context.getAttribute( Globals.ACTION_SERVLET_KEY );
    }