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

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.

主站蜘蛛池模板: 太康县| 临武县| 高雄市| 屯昌县| 云浮市| 泰兴市| 茌平县| 喀喇沁旗| 南投市| 百色市| 望江县| 兰州市| 武威市| 通化市| 崇阳县| 夏津县| 焦作市| 砚山县| 康平县| 上高县| 延寿县| 东阿县| 嵊州市| 郑州市| 谢通门县| 丰台区| 安徽省| 革吉县| 平江县| 鄂托克前旗| 三江| 河北区| 宾川县| 天峨县| 湖口县| 龙门县| 东明县| 基隆市| 龙南县| 赤峰市| 刚察县|