Tomcat的核心是Connector和Container,被Service包装,所有的Service由最外层的Server统一管理 图 Server->service1(多个service)->Connectors(每个service对应多个connector)->Engine(处理引擎)->Host(多个主机资源)->C...
Tomcat的核心是Connector和Container,被Service包装,所有的Service由最外层的Server统一管理
Server->service1(多个service)->Connectors(每个service对应多个connector)->Engine(处理引擎)->Host(多个主机资源)->Context(多个虚拟目录)
组织结构描述
Server
Service
Contector
Engine
Host
Context
样本描述
http://localhost:8080/wsota/wsota_index.jsp
发送请求到8080端口,被Connector监听获取
Connector完成http协议解析,把请求交给Service的Engine处理,等待Engine的返回
Engine获取localhost:8080/wsota/wsota_index.jsp,进行虚拟主机的匹配,找到localhost的Host
Engine获取wsota/wsota_index.jsp,进行虚拟目录的匹配,找到Host的wsota对应的Context
path为wsota的Context对象获取wsota_index.jsp,开始找到这个url的映射的servlet,主要看.jsp后缀
开始构造httpServletRequest和HttpServletResponse对象,作为参数传递给Servlet的doGet和doPost方法
Context把处理之后的HttpServletResponse对象返回给Host
Host对象把HttpServletResponse对象返回给Engine
Engine对象把HttpServletResponse对象返回给Connector
Connector对象把HttpServletResponse返回给浏览器
Connector关闭Socket
上一篇:Mac 下配置php环境
下一篇:Nginx配置文件详细说明
免责声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,也不承认相关法律责任。如果您发现本社区中有涉嫌抄袭的内容,请发送邮件至:operations@xinnet.com进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。