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

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[] { "/" };
}

}
主站蜘蛛池模板: 镇赉县| 新田县| 上饶市| 且末县| 山阳县| 绍兴市| 昔阳县| 廊坊市| 达拉特旗| 武义县| 集安市| 砚山县| 内黄县| 阿荣旗| 侯马市| 奈曼旗| 巫山县| 临颍县| 沭阳县| 岳普湖县| 介休市| 林周县| 香格里拉县| 平湖市| 拉孜县| 广灵县| 成武县| 保靖县| 鹤庆县| 涪陵区| 镇原县| 宁化县| 台湾省| 蒲城县| 团风县| 鸡西市| 潼关县| 昌图县| 乐山市| 甘谷县| 鄯善县|