springboot源码解读01
2024-10-10 06:17:22
package org.springframework.web; @javax.servlet.annotation.HandlesTypes({org.springframework.web.WebApplicationInitializer.class}) public class SpringServletContainerInitializer implements javax.servlet.ServletContainerInitializer { public SpringServletContainerInitializer() { /* compiled code */ } public void onStartup(@org.springframework.lang.Nullable java.util.Set<java.lang.Class<?>> webAppInitializerClasses, javax.servlet.ServletContext servletContext) throws javax.servlet.ServletException { /* compiled code */ } }
这段代码是springboot的启动代码。
1.注解不仅可以用在方法上,也可以用在参数上。
2.在servlet3.0环境中,容器会查找实现了javax.servlet.ServletContainerInitializer接口的类,如代码中的SpringServletContainerInitializer,就会使用其配置servlet容器。而该类又会查找实现了WebApplicationInitializer的类,AbstractAnnotationConfigDispatcherServletInitializer就实现了该类。
3.问题,如何在springboot中自定义自己的拦截器?
最新文章
- Linux iptables 防火墙
- Linux杂乱小知识点
- Ixia测试仪的自动化
- Server Error in &#39;/&#39; Application
- Android性能优化方法(八)
- HTML5播放器FlowPlayer的极简风格效果
- .htaccess 语法以及应用
- http://blog.csdn.net/clementad/article/details/47403185
- jQuery dialog 简介
- PHP中使用curlL实现GET和POST请求的方法
- 配置nginx支持thinkphp框架
- osg配置
- [Angular 2] Pipes with Multiple Parameters
- Java对象和Excel转换工具XXL-EXCEL
- 宝塔面板设置腾迅COS自动备份网站
- 用js实现一个简单的mvvm
- os.rename 和os.replace
- 一步步教你上架iOS APP
- PHP直接将文件流转换为字符串
- CF 166E Tetrahedron
热门文章
- Codeforces899D Shovel Sale(思路)
- Spring quartz 单机、集群+websocket集群实现文本、图片、声音、文件下载及推送、接收及显示
- 完善mui的tap及longtap点击效果
- Linux 端口转发一则
- 每天一个linux命令(14):head命令
- 【转】关于免费SSL证书的那些事儿
- 【nginx&;php】后台权限认证方式
- MATLAB 程序处理结果出现 NAN 问题
- WPF宝典Url
- Android开发导出apk报错:Unable to build: the file dx.jar was not loaded from the SDK folder