javax.faces.bean.SessionScoped Java Examples
The following examples show how to use
javax.faces.bean.SessionScoped.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JsfScopeAnnotationsAutoConfiguration.java From joinfaces with Apache License 2.0 | 6 votes |
@Bean @ConditionalOnProperty(value = "joinfaces.scope-configurer.jsf.enabled", havingValue = "true", matchIfMissing = true) public static CustomScopeAnnotationConfigurer jsfScopeAnnotationsConfigurer(Environment environment) { CustomScopeAnnotationConfigurer scopeAnnotationConfigurer = new CustomScopeAnnotationConfigurer(); scopeAnnotationConfigurer.setOrder(environment.getProperty("joinfaces.scope-configurer.jsf.order", Integer.class, Ordered.LOWEST_PRECEDENCE)); scopeAnnotationConfigurer.addMapping(NoneScoped.class, ConfigurableBeanFactory.SCOPE_PROTOTYPE); scopeAnnotationConfigurer.addMapping(RequestScoped.class, WebApplicationContext.SCOPE_REQUEST); scopeAnnotationConfigurer.addMapping(ViewScoped.class, ViewScope.SCOPE_VIEW); scopeAnnotationConfigurer.addMapping(SessionScoped.class, WebApplicationContext.SCOPE_SESSION); scopeAnnotationConfigurer.addMapping(ApplicationScoped.class, WebApplicationContext.SCOPE_APPLICATION); try { Class<? extends Annotation> cdiViewScopedClass = (Class<? extends Annotation>) Class.forName("javax.faces.view.ViewScoped"); scopeAnnotationConfigurer.addMapping(cdiViewScopedClass, ViewScope.SCOPE_VIEW); } catch (ClassNotFoundException ignored) { // JSF 2.1 or lower } return scopeAnnotationConfigurer; }