官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 遂平县| 泗水县| 翼城县| 子长县| 遵化市| 桐城市| 盐亭县| 千阳县| 育儿| 秦皇岛市| 禹州市| 日照市| 兰考县| 潼南县| 广元市| 利川市| 汝州市| 浠水县| 双流县| 巫山县| 丽水市| 望都县| 西乡县| 佛山市| 星子县| 杭锦后旗| 吉木乃县| 石棉县| 广德县| 甘孜| 温州市| 武乡县| 大姚县| 崇明县| 海丰县| 乌审旗| 邓州市| 永平县| 星座| 荣成市| 阜平县|