- Hands-On Spring Security 5 for Reactive Applications
- Tomcy John
- 62字
- 2021-07-23 18:59:22
Step 6—Web application configuration
In this example, we are going to use Spring MVC as our web application framework. Let's create the web application configuration file:
@Configuration
@EnableWebMvc
@ComponentScan(basePackages= {"com.packtpub.book.ch02.springsecurity.controller"})
public class WebApplicationConfig implements WebMvcConfigurer {
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
registry.jsp().prefix("/WEB-INF/views/").suffix(".jsp");
}
}
The @EnableWebMvc annotation makes sure that your application is based on Spring MVC.