Merge pull request #9901 from eugenp/remove-spring-all

removed spring-all module
This commit is contained in:
Loredana Crusoveanu 2020-08-21 15:03:33 +03:00 committed by GitHub
commit 069d72e3d2
2 changed files with 0 additions and 64 deletions

View File

@ -1,3 +0,0 @@
## Spring All
This module contains articles about Spring

View File

@ -1,61 +0,0 @@
package org.baeldung.scopes;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.JstlView;
import org.springframework.web.servlet.view.UrlBasedViewResolver;
@Configuration
@ComponentScan("org.baeldung.scopes")
@EnableWebMvc
public class ScopesConfig {
@Bean
public UrlBasedViewResolver setupViewResolver() {
final UrlBasedViewResolver resolver = new UrlBasedViewResolver();
resolver.setPrefix("/WEB-INF/view/");
resolver.setSuffix(".jsp");
resolver.setViewClass(JstlView.class);
return resolver;
}
@Bean
@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)
public HelloMessageGenerator requestScopedBean() {
return new HelloMessageGenerator();
}
@Bean
@Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.TARGET_CLASS)
public HelloMessageGenerator sessionScopedBean() {
return new HelloMessageGenerator();
}
@Bean
@Scope(value = WebApplicationContext.SCOPE_APPLICATION, proxyMode = ScopedProxyMode.TARGET_CLASS)
public HelloMessageGenerator applicationScopedBean() {
return new HelloMessageGenerator();
}
@Bean
@Scope(scopeName = "websocket", proxyMode = ScopedProxyMode.TARGET_CLASS)
public HelloMessageGenerator websocketScopedBean() {
return new HelloMessageGenerator();
}
@Bean
@Scope("prototype")
public Person personPrototype() {
return new Person();
}
@Bean
@Scope("singleton")
public Person personSingleton() {
return new Person();
}
}