removed spring-all module
This commit is contained in:
parent
6247c9b9bc
commit
ebd334c9c5
|
@ -1,3 +0,0 @@
|
||||||
## Spring All
|
|
||||||
|
|
||||||
This module contains articles about Spring
|
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue