1 Apache Tomcat
静态资源处理
可以为web.xml文件中查看
可以查看这个类org.apache.catalina.servlets.DefaultServlet的doGet方法具体实现
2 Spring Boot 嵌入式Web容器
嵌入式的tomcat处理这几个资源所涉及的类和基本实现原理
Embedded Tomcat
静态资源处理
欢迎页面(Welcome file list)
JSP处理
类加载(Classloading)
连接器(Connectors)
配置接口
在
/META-INF/spring-configuration-metadata.json 中查看对应的类
{
"name": "server.port",
"type": "java.lang.Integer",
"description": "Server HTTP port.",
"sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties"
}
在该类中有port属性,有getport方法,在方法在org.springframework.boot.autoconfigure.web.ServerProperties.class
类的customize中被调用
该方法是继承接口EmbeddedServletContainerCustomizer