Package org.springframework.web.context

Examples of org.springframework.web.context.WebApplicationContext


                    }
                } catch (Exception e) {
                    logger.error("Error executing test", e);
                }
            } else {
                WebApplicationContext webApplicationContext = (WebApplicationContext) servletContext.getAttribute(WebApplicationContext.class.getName() + ".jahiaModules");
                Map<String,TestBean> testBeans = webApplicationContext.getBeansOfType(TestBean.class);

                PrintWriter pw = httpServletResponse.getWriter();
                // Return the lists of available tests
                List<String> tests = new LinkedList<String>();
                SortedSet<TestBean> s = new TreeSet<TestBean>(testBeans.values());
View Full Code Here


        }
        return classes;
    }
   
    private Set<String> getIgnoreTests() {
        WebApplicationContext webApplicationContext = (WebApplicationContext) servletContext.getAttribute(WebApplicationContext.class.getName() + ".jahiaModules");
        Map<String,TestBean> testBeans = webApplicationContext.getBeansOfType(TestBean.class);

        // Return the lists of available tests
        Set<String> ignoreTests = new HashSet<String>();

        SortedSet<TestBean> s = new TreeSet<TestBean>(testBeans.values());
View Full Code Here

    this.code = code;
  }
 
  @Override
  public int doStartTag() throws JspException {
    WebApplicationContext webApplicationContext = RequestContextUtils
        .getWebApplicationContext(pageContext.getRequest());
    PermissionService permissionService = webApplicationContext.getBean(PermissionService.class);
    Project project = (Project) pageContext.getRequest().getAttribute(PROJECT_KEY);
    User user = (User) pageContext.getRequest().getAttribute(USER_KEY);
    if(permissionService.hasPermission(project, user, code)) {
      return EVAL_BODY_INCLUDE;
    }
View Full Code Here

           
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("Using ISpringPortletChannel named '" + beanName + "'");
            }
           
            final WebApplicationContext applicationContext = sd.getWebApplicationContext();
            if (applicationContext == null) {
                throw new IllegalStateException("No WebApplicationContext provided by ChannelStaticData");
            }
           
            final ISpringPortletChannel springPortletChannel = (ISpringPortletChannel)applicationContext.getBean(beanName, ISpringPortletChannel.class);
           
            //Initialize the static channel immediately with the instance data
            springPortletChannel.initSession(sd, portalControlStructures);
           
            //Only set the local variables if the initSession call completes
View Full Code Here

    public void testInitLifecycle() throws Exception {
        this.sd.setParameter("springBeanName", "portletChannel");
       
        final PortalControlStructures pcs = new PortalControlStructures(new MockHttpServletRequest(), null);
       
        final WebApplicationContext webApplicationContext = EasyMock.createMock(WebApplicationContext.class);
        EasyMock.expect(webApplicationContext.getBean("portletChannel", ISpringPortletChannel.class)).andReturn(this.portletChannel);
        EasyMock.replay(webApplicationContext);

        this.sd.setWebApplicationContext(webApplicationContext);
       
        EasyMock.reset(this.portletChannel);
View Full Code Here

                LOGGER.error(createException, createException);
                LOGGER.error("Stack trace of original ApplicationContext creator", directCreatorThrowable);
                throw createException;
            }

            final WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(context);
            if (webApplicationContext == null) {
                throw new IllegalStateException("ServletContext is available but WebApplicationContextUtils.getWebApplicationContext(ServletContext) returned null. Either the application context failed to load or is not yet done loading.");
            }
            return webApplicationContext;
        }
View Full Code Here

    @Override
    protected final void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {

        if (RERUN_PARAM.equals(request.getParameter(RERUN_PARAM))) {
            final ServletContext servletContext = getServletContext();
            final WebApplicationContext webAppCtx = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
            final InitializingCheckRunner checkRunner = (InitializingCheckRunner)webAppCtx.getBean("initializingCheckRunning", InitializingCheckRunner.class);
            servletContext.setAttribute(InitializingCheckRunner.INIT_CHECK_RESULTS, checkRunner);
        }

        doGet(request, response);
    }
View Full Code Here

     */
    public void sessionCreated(HttpSessionEvent se) {
        final HttpSession session = se.getSession();
        final HttpSessionCreatedEvent httpSessionCreatedEvent = new HttpSessionCreatedEvent(session);
       
        final WebApplicationContext webApplicationContext = this.getWebApplicationContext(session);
        webApplicationContext.publishEvent(httpSessionCreatedEvent);
    }
View Full Code Here

     */
    public void sessionDestroyed(HttpSessionEvent se) {
        final HttpSession session = se.getSession();
        final HttpSessionDestroyedEvent httpSessionDestroyedEvent = new HttpSessionDestroyedEvent(session);
       
        final WebApplicationContext webApplicationContext = this.getWebApplicationContext(session);
        webApplicationContext.publishEvent(httpSessionDestroyedEvent);
    }
View Full Code Here

      printError(response, "Your session has timed out.  Please log in again to make changes to your layout.");
      return;
    }

    try {
            final WebApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());
            userInstanceManager = (IUserInstanceManager) applicationContext.getBean("userInstanceManager", IUserInstanceManager.class);

           
      // Retrieve the user's UserInstance object
      ui = userInstanceManager.getUserInstance(request);
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.