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

Step 7—Spring MVC setup

In Spring MVC, the request lands on DispatcherServlet. DispatcherServlet can be declared in web.xml or as a Java configuration if your servlet container is 3.0+. Please create a dummy SpringSecurityConfig.java file. We will be constructing this class when we explain the first authentication mechanism, namely, basic authentication:

public class SpringMvcWebApplicationInitializer
extends AbstractAnnotationConfigDispatcherServletInitializer {

@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[] { ApplicationConfig.class, SpringSecurityConfig.class };
}

@Override
protected Class<?>[] getServletConfigClasses() {
return new Class[] { WebApplicationConfig.class };
}

@Override
protected String[] getServletMappings() {
return new String[] { "/" };
}

}
主站蜘蛛池模板: 綦江县| 五指山市| 兴化市| 综艺| 东兰县| 新巴尔虎右旗| 黄骅市| 云龙县| 大同县| 舒兰市| 驻马店市| 宝鸡市| 太原市| 广饶县| 邹平县| 贵南县| 南昌市| 昭通市| 阿尔山市| 枣庄市| 胶州市| 安阳县| 龙州县| 德钦县| 六枝特区| 西乡县| 崇州市| 三明市| 涿州市| 九龙县| 奉新县| 类乌齐县| 芦山县| 镇平县| 武安市| 桂东县| 宁城县| 富宁县| 昌邑市| 都兰县| 永定县|