Package org.springframework.web.context

Examples of org.springframework.web.context.WebApplicationContext


        }
    }

    public void contextDestroyed( ServletContextEvent contextEvent )
    {
        WebApplicationContext applicationContext =
            WebApplicationContextUtils.getRequiredWebApplicationContext( contextEvent.getServletContext() );

        // TODO check this stop

        /*
 
View Full Code Here


        Binding binding = new Binding();
        binding.setVariable("authenticator", new Authenticator());

        BeanBuilder builder = new BeanBuilder();
        builder.parse(Jenkins.getInstance().servletContext.getResourceAsStream("/WEB-INF/security/AbstractPasswordBasedSecurityRealm.groovy"),binding);
        WebApplicationContext context = builder.createApplicationContext();
        return new SecurityComponents(
                findBean(AuthenticationManager.class, context),this);
    }
View Full Code Here

                    override.exists() ? new AutoCloseInputStream(new FileInputStream(override)) :
                    Jenkins.getInstance().servletContext.getResourceAsStream("/WEB-INF/security/"+ fileName),binding);
        } catch (FileNotFoundException e) {
            throw new Error("Failed to load "+fileName,e);
        }
        WebApplicationContext appContext = builder.createApplicationContext();

        ldapTemplate = new LdapTemplate(findBean(InitialDirContextFactory.class, appContext));

        return new SecurityComponents(
            findBean(AuthenticationManager.class, appContext),
View Full Code Here

        SecurityComponents sc = getSecurityComponents();
        binding.setVariable("securityComponents", sc);
        binding.setVariable("securityRealm",this);
        BeanBuilder builder = new BeanBuilder();
        builder.parse(filterConfig.getServletContext().getResourceAsStream("/WEB-INF/security/SecurityFilters.groovy"),binding);
        WebApplicationContext context = builder.createApplicationContext();
        return (Filter) context.getBean("filter");
    }
View Full Code Here

    @Before
    public void setup() throws JspException {
        context = new RenderContext();
        service = createNiceMock(RenderService.class);
        WebApplicationContext wContext = createNiceMock(WebApplicationContext.class);
        expect(wContext.getBean(RenderService.class)).andReturn(service).anyTimes();
        replay(wContext);
        ServletContext servletContext = createNiceMock(ServletContext.class);
        expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(wContext);
        replay(servletContext);
        ServletRequest request = new MockHttpServletRequest();
View Full Code Here

    public void contextInitialized(ServletContextEvent event) {
        LOG.info("Starting up Pluto Portal Driver. . .");

        ServletContext servletContext = event.getServletContext();

        WebApplicationContext springContext = (WebApplicationContext)
                servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

        LOG.debug(" [1a] Loading DriverConfiguration. . . ");
        DriverConfiguration driverConfiguration = (DriverConfiguration)
                springContext.getBean("DriverConfiguration");

        driverConfiguration.init(servletContext);

        LOG.debug(" [1b] Registering DriverConfiguration. . .");
        servletContext.setAttribute(DRIVER_CONFIG_KEY, driverConfiguration);


        LOG.debug(" [2a] Loading Optional AdminConfiguration. . .");
        AdminConfiguration adminConfiguration = (AdminConfiguration)
                springContext.getBean("AdminConfiguration");

        if (adminConfiguration != null) {
            LOG.debug(" [2b] Registering Optional AdminConfiguration");
            servletContext.setAttribute(ADMIN_CONFIG_KEY, adminConfiguration);
        } else {
View Full Code Here

     *
     * @param servletContext the servlet context.
     */
    private void initContainer(ServletContext servletContext) {

        WebApplicationContext springContext = (WebApplicationContext)
                servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

        // Retrieve the driver configuration from servlet context.
        DriverConfiguration driverConfig = (DriverConfiguration)
                servletContext.getAttribute(DRIVER_CONFIG_KEY);

        try {
            LOG.info("Initializing Portlet Container. . .");

            LOG.debug(" [1] Loading RequiredContainerServices. . .");
            RequiredContainerServices required =
                    (RequiredContainerServices) springContext.getBean("RequiredContainerServices");

            LOG.debug(" [2] Loading OptionalContainerServices. . .");
            OptionalContainerServices optional =
                    (OptionalContainerServices) springContext.getBean("OptionalContainerServices");


            // Create portlet container.
            LOG.debug(" [3] Creating portlet container...");
            PortletContainerFactory factory =
View Full Code Here

     * @InjectService.
     */
    public static WebApplicationContext build(@InjectService("Context")
    Context context)
    {
        WebApplicationContext springContext = null;

        try
        {
            springContext = (WebApplicationContext) context
                    .getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
View Full Code Here

    public void contextInitialized(ServletContextEvent event) {
        LOG.debug("Initializing ActiveMQ WebConsole...");

        ServletContext servletContext = event.getServletContext();
        WebApplicationContext context = createWebapplicationContext(servletContext);

        initializeWebClient(servletContext, context);

        LOG.info("ActiveMQ WebConsole initialized.");
    }
View Full Code Here

        this.applicationContextName = getInitParameter(config, "applicationContextName", applicationContextName);
        this.requestContextName = getInitParameter(config, "requestContextName", requestContextName);
        this.requestName = getInitParameter(config, "requestName", requestName);

        // register the application context in the applicationScope
        WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        Map wrapper = createApplicationContextWrapper(context);
        servletContext.setAttribute(applicationContextName, wrapper);
    }
View Full Code Here

TOP

Related Classes of org.springframework.web.context.WebApplicationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.