Package org.springframework.web.context.request

Examples of org.springframework.web.context.request.SessionScope


  public void setUpApplicationContextWithScopes(ConfigurableApplicationContext applicationContext) {
    assert applicationContext!=null;
    ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
    beanFactory.registerScope("request", new RequestScope());
    beanFactory.registerScope("session", new SessionScope(false));
    beanFactory.registerScope("globalSession", new SessionScope(true));

    beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(getServletContext(),
        getConfig()));
    beanFactory.ignoreDependencyInterface(ServletContextAware.class);
    beanFactory.ignoreDependencyInterface(ServletConfigAware.class);
View Full Code Here


   * @param beanFactory the BeanFactory to configure
   * @param pc the PortletContext that we're running within
   */
  static void registerPortletApplicationScopes(ConfigurableListableBeanFactory beanFactory, PortletContext pc) {
    beanFactory.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
    beanFactory.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope(false));
    beanFactory.registerScope(WebApplicationContext.SCOPE_GLOBAL_SESSION, new SessionScope(true));
    if (pc != null) {
      PortletContextScope appScope = new PortletContextScope(pc);
      beanFactory.registerScope(WebApplicationContext.SCOPE_APPLICATION, appScope);
      // Register as PortletContext attribute, for ContextCleanupListener to detect it.
      pc.setAttribute(PortletContextScope.class.getName(), appScope);
View Full Code Here

   * @param beanFactory the BeanFactory to configure
   * @param sc the ServletContext that we're running within
   */
  public static void registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory, ServletContext sc) {
    beanFactory.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
    beanFactory.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope(false));
    beanFactory.registerScope(WebApplicationContext.SCOPE_GLOBAL_SESSION, new SessionScope(true));
    if (sc != null) {
      ServletContextScope appScope = new ServletContextScope(sc);
      beanFactory.registerScope(WebApplicationContext.SCOPE_APPLICATION, appScope);
      // Register as ServletContext attribute, for ContextCleanupListener to detect it.
      sc.setAttribute(ServletContextScope.class.getName(), appScope);
View Full Code Here

   * @param beanFactory the BeanFactory to configure
   * @param sc the ServletContext that we're running within
   */
  public static void registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory, ServletContext sc) {
    beanFactory.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
    beanFactory.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope(false));
    beanFactory.registerScope(WebApplicationContext.SCOPE_GLOBAL_SESSION, new SessionScope(true));
    if (sc != null) {
      ServletContextScope appScope = new ServletContextScope(sc);
      beanFactory.registerScope(WebApplicationContext.SCOPE_APPLICATION, appScope);
      // Register as ServletContext attribute, for ContextCleanupListener to detect it.
      sc.setAttribute(ServletContextScope.class.getName(), appScope);
View Full Code Here

  /**
   * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc.
   */
  protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
    beanFactory.registerScope(SCOPE_REQUEST, new RequestScope());
    beanFactory.registerScope(SCOPE_SESSION, new SessionScope(false));
    beanFactory.registerScope(SCOPE_GLOBAL_SESSION, new SessionScope(true));

    beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
    beanFactory.ignoreDependencyInterface(ServletContextAware.class);
    beanFactory.ignoreDependencyInterface(ServletConfigAware.class);
  }
View Full Code Here

   * as used by the WebApplicationContext.
   * @param beanFactory the BeanFactory to configure
   */
  public static void registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory) {
    beanFactory.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
    beanFactory.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope(false));
    beanFactory.registerScope(WebApplicationContext.SCOPE_GLOBAL_SESSION, new SessionScope(true));

    beanFactory.registerResolvableDependency(ServletRequest.class, new ObjectFactory() {
      public Object getObject() {
        RequestAttributes requestAttr = RequestContextHolder.currentRequestAttributes();
        if (!(requestAttr instanceof ServletRequestAttributes)) {
View Full Code Here

  /**
   * Register request/session scopes, a {@link PortletContextAwareProcessor}, etc.
   */
  protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
    beanFactory.registerScope(SCOPE_REQUEST, new RequestScope());
    beanFactory.registerScope(SCOPE_SESSION, new SessionScope(false));
    beanFactory.registerScope(SCOPE_GLOBAL_SESSION, new SessionScope(true));

    beanFactory.addBeanPostProcessor(new PortletContextAwareProcessor(this.portletContext, this.portletConfig));
    beanFactory.ignoreDependencyInterface(PortletContextAware.class);
    beanFactory.ignoreDependencyInterface(PortletConfigAware.class);
  }
View Full Code Here

  /**
   * Register request/session scopes, a {@link PortletContextAwareProcessor}, etc.
   */
  protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
    beanFactory.registerScope(SCOPE_REQUEST, new RequestScope());
    beanFactory.registerScope(SCOPE_SESSION, new SessionScope(false));
    beanFactory.registerScope(SCOPE_GLOBAL_SESSION, new SessionScope(true));

    beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext));
    beanFactory.addBeanPostProcessor(new PortletContextAwareProcessor(this.portletContext, this.portletConfig));
    beanFactory.ignoreDependencyInterface(ServletContextAware.class);
    beanFactory.ignoreDependencyInterface(PortletContextAware.class);
View Full Code Here

   * Register ServletContextAwareProcessor.
   * @see ServletContextAwareProcessor
   */
  protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
    beanFactory.registerScope(SCOPE_REQUEST, new RequestScope());
    beanFactory.registerScope(SCOPE_SESSION, new SessionScope(false));
    beanFactory.registerScope(SCOPE_GLOBAL_SESSION, new SessionScope(true));

    beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext));
    beanFactory.ignoreDependencyInterface(ServletContextAware.class);
  }
View Full Code Here

  /**
   * Register request/session scopes, a {@link ServletContextAwareProcessor}, etc.
   */
  protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
    beanFactory.registerScope(SCOPE_REQUEST, new RequestScope());
    beanFactory.registerScope(SCOPE_SESSION, new SessionScope(false));
    beanFactory.registerScope(SCOPE_GLOBAL_SESSION, new SessionScope(true));

    beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
    beanFactory.ignoreDependencyInterface(ServletContextAware.class);
    beanFactory.ignoreDependencyInterface(ServletConfigAware.class);
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.context.request.SessionScope

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.