- 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)險與防范
- INSTANT Netcat Starter
- 數(shù)字身份與元宇宙信任治理
- 計算機(jī)病毒分析與防范大全(第3版)
- 安全技術(shù)運營:方法與實踐
- 防火墻技術(shù)與應(yīng)用(第2版)
- 計算機(jī)網(wǎng)絡(luò)安全基礎(chǔ)(第5版)
- 隱私保護(hù)機(jī)器學(xué)習(xí)
- CPK通向賽博安全之路:理論與實踐CPK Solution to Cyber Security:Theory and Practice
- 企業(yè)安全建設(shè)入門:基于開源軟件打造企業(yè)網(wǎng)絡(luò)安全
- 大中型網(wǎng)絡(luò)入侵要案直擊與防御
- 網(wǎng)絡(luò)空間安全實踐能力分級培養(yǎng)(I)
- 計算機(jī)病毒揭秘與對抗
- 網(wǎng)絡(luò)安全應(yīng)急響應(yīng)基礎(chǔ)理論及關(guān)鍵技術(shù)
- 商用密碼發(fā)展報告(2012—2017年)