- Hands-On Spring Security 5 for Reactive Applications
- Tomcy John
- 97字
- 2021-07-23 18:59:22
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[] { "/" };
}
}
推薦閱讀
- 攻守道:企業(yè)數(shù)字業(yè)務(wù)安全風(fēng)險(xiǎn)與防范
- Securing Blockchain Networks like Ethereum and Hyperledger Fabric
- 開(kāi)發(fā)者的Web安全戒律:真實(shí)威脅與防御實(shí)踐
- Web安全與攻防入門很輕松(實(shí)戰(zhàn)超值版)
- Preventing Digital Extortion
- API攻防:Web API安全指南
- 網(wǎng)絡(luò)安全三十六計(jì):人人該懂的防黑客技巧
- 數(shù)據(jù)安全與隱私計(jì)算(第3版)
- 網(wǎng)絡(luò)安全能力成熟度模型:原理與實(shí)踐
- 互聯(lián)網(wǎng)企業(yè)安全高級(jí)指南
- 華為防火墻實(shí)戰(zhàn)指南
- 空間群組密鑰管理研究:基于自主的深空DTN密鑰管理
- 信息安全工程與實(shí)踐
- Mastering Python for Networking and Security
- 黑客攻防從入門到精通:黑客與反黑客工具篇(第2版)