Tabnine Logo
SessionScope
Code IndexAdd Tabnine to your IDE (free)

How to use
SessionScope
in
org.springframework.web.context.request

Best Java code snippets using org.springframework.web.context.request.SessionScope (Showing top 7 results out of 315)

origin: spring-projects/spring-framework

@Before
public void setup() throws Exception {
  this.beanFactory.registerScope("session", new SessionScope());
  XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);
  reader.loadBeanDefinitions(new ClassPathResource("sessionScopeTests.xml", getClass()));
}
origin: spring-projects/spring-framework

/**
 * Register web-specific scopes ("request", "session", "globalSession", "application")
 * with the given BeanFactory, as used by the WebApplicationContext.
 * @param beanFactory the BeanFactory to configure
 * @param sc the ServletContext that we're running within
 */
public static void registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory,
    @Nullable ServletContext sc) {
  beanFactory.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
  beanFactory.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope());
  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);
  }
  beanFactory.registerResolvableDependency(ServletRequest.class, new RequestObjectFactory());
  beanFactory.registerResolvableDependency(ServletResponse.class, new ResponseObjectFactory());
  beanFactory.registerResolvableDependency(HttpSession.class, new SessionObjectFactory());
  beanFactory.registerResolvableDependency(WebRequest.class, new WebRequestObjectFactory());
  if (jsfPresent) {
    FacesDependencyRegistrar.registerFacesDependencies(beanFactory);
  }
}
origin: org.springframework/spring-web

/**
 * Register web-specific scopes ("request", "session", "globalSession", "application")
 * with the given BeanFactory, as used by the WebApplicationContext.
 * @param beanFactory the BeanFactory to configure
 * @param sc the ServletContext that we're running within
 */
public static void registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory,
    @Nullable ServletContext sc) {
  beanFactory.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
  beanFactory.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope());
  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);
  }
  beanFactory.registerResolvableDependency(ServletRequest.class, new RequestObjectFactory());
  beanFactory.registerResolvableDependency(ServletResponse.class, new ResponseObjectFactory());
  beanFactory.registerResolvableDependency(HttpSession.class, new SessionObjectFactory());
  beanFactory.registerResolvableDependency(WebRequest.class, new WebRequestObjectFactory());
  if (jsfPresent) {
    FacesDependencyRegistrar.registerFacesDependencies(beanFactory);
  }
}
origin: org.springframework/org.springframework.web.portlet

/**
 * Register web-specific scopes ("request", "session", "globalSession")
 * with the given BeanFactory, as used by the Portlet ApplicationContext.
 * @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);
  }
  beanFactory.registerResolvableDependency(PortletRequest.class, new RequestObjectFactory());
  beanFactory.registerResolvableDependency(PortletSession.class, new SessionObjectFactory());
  beanFactory.registerResolvableDependency(WebRequest.class, new WebRequestObjectFactory());
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-web

/**
 * Register web-specific scopes ("request", "session", "globalSession", "application")
 * with the given BeanFactory, as used by the WebApplicationContext.
 * @param beanFactory the BeanFactory to configure
 * @param sc the ServletContext that we're running within
 */
public static void registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory,
    @Nullable ServletContext sc) {
  beanFactory.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
  beanFactory.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope());
  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);
  }
  beanFactory.registerResolvableDependency(ServletRequest.class, new RequestObjectFactory());
  beanFactory.registerResolvableDependency(ServletResponse.class, new ResponseObjectFactory());
  beanFactory.registerResolvableDependency(HttpSession.class, new SessionObjectFactory());
  beanFactory.registerResolvableDependency(WebRequest.class, new WebRequestObjectFactory());
  if (jsfPresent) {
    FacesDependencyRegistrar.registerFacesDependencies(beanFactory);
  }
}
origin: org.springframework/spring-webmvc-portlet

/**
 * Register web-specific scopes ("request", "session", "globalSession")
 * with the given BeanFactory, as used by the Portlet ApplicationContext.
 * @param bf the BeanFactory to configure
 * @param pc the PortletContext that we're running within
 */
static void registerPortletApplicationScopes(ConfigurableListableBeanFactory bf, PortletContext pc) {
  bf.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
  bf.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope(false));
  bf.registerScope(WebApplicationContext.SCOPE_GLOBAL_SESSION, new SessionScope(true));
  if (pc != null) {
    PortletContextScope appScope = new PortletContextScope(pc);
    bf.registerScope(WebApplicationContext.SCOPE_APPLICATION, appScope);
    // Register as PortletContext attribute, for ContextCleanupListener to detect it.
    pc.setAttribute(PortletContextScope.class.getName(), appScope);
  }
  bf.registerResolvableDependency(PortletRequest.class, new RequestObjectFactory());
  bf.registerResolvableDependency(PortletResponse.class, new ResponseObjectFactory());
  bf.registerResolvableDependency(PortletSession.class, new SessionObjectFactory());
  bf.registerResolvableDependency(WebRequest.class, new WebRequestObjectFactory());
}
origin: apache/servicemix-bundles

/**
 * Register web-specific scopes ("request", "session", "globalSession", "application")
 * with the given BeanFactory, as used by the WebApplicationContext.
 * @param beanFactory the BeanFactory to configure
 * @param sc the ServletContext that we're running within
 */
public static void registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory,
    @Nullable ServletContext sc) {
  beanFactory.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
  beanFactory.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope());
  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);
  }
  beanFactory.registerResolvableDependency(ServletRequest.class, new RequestObjectFactory());
  beanFactory.registerResolvableDependency(ServletResponse.class, new ResponseObjectFactory());
  beanFactory.registerResolvableDependency(HttpSession.class, new SessionObjectFactory());
  beanFactory.registerResolvableDependency(WebRequest.class, new WebRequestObjectFactory());
  if (jsfPresent) {
    FacesDependencyRegistrar.registerFacesDependencies(beanFactory);
  }
}
org.springframework.web.context.requestSessionScope

Javadoc

Session-backed org.springframework.beans.factory.config.Scopeimplementation.

Relies on a thread-bound RequestAttributes instance, which can be exported through RequestContextListener, org.springframework.web.filter.RequestContextFilter or org.springframework.web.servlet.DispatcherServlet.

Most used methods

  • <init>

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JPanel (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now