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

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.

主站蜘蛛池模板: 五原县| 海晏县| 邢台市| 富源县| 开平市| 若尔盖县| 凤山市| 工布江达县| 宣武区| 阿克苏市| 成都市| 铜陵市| 定兴县| 蓬安县| 安远县| 广汉市| 大兴区| 铜山县| 台东市| 安吉县| 称多县| 华坪县| 莱阳市| 洛川县| 洪泽县| 海晏县| 金湖县| 高安市| 安宁市| 方山县| 苏尼特右旗| 贵阳市| 南岸区| 且末县| 秦皇岛市| 广饶县| 玉山县| 仙游县| 云霄县| 新昌县| 澜沧|