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

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.

主站蜘蛛池模板: 辽宁省| 华容县| 浮山县| 明光市| 股票| 慈利县| 柏乡县| 建水县| 苍南县| 大连市| 岑溪市| 新河县| 柳河县| 峡江县| 县级市| 满城县| 都兰县| 金山区| 特克斯县| 清远市| 徐水县| 洞口县| 全州县| 海南省| 安仁县| 绥滨县| 长顺县| 清苑县| 颍上县| 凤庆县| 任丘市| 丽江市| 镇康县| 乌海市| 桂阳县| 益阳市| 大理市| 鄯善县| 雷山县| 炉霍县| 望城县|