版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
渐行渐远的 ServletServlet是一种基JavaWeb组件,用于生成动态内容,由容器管理。类似于其他Java技术组件,Servlet是平台无Java类组成,并且JavaWeb服务器加载执行。通常情况Servlet容器提供运行时环境。Servlet容器,有时候也称作为Servlet引擎,作为Web服务器或应用服务器的一部分。通过请求和响应,提供Web客户端与Servlets交互的能从功能上,Servlet介于CGI(CommonGatewayInterface)与服务扩展(如:NetscapeServerAPI或Apache模块)之在体系上,Servlet技术(或者规范)属于JavaEE技术(规范)的一部分。不过Servlet并非一开始就隶属于J2EEJavaEE。接下来的小节将会介绍ServletServlet版Java平Servlet20179JavaEEServlet20135JavaEE非阻塞I/O、HTTP协议更新机制Servlet200912JavaEEServlet20059JavaEEAnnotationServlet200311J2EEweb.xml支持XMLServlet20018J2EE新增Filter Servlet19998J2EEJ2EE的一部分,以.war文件作为独立web应Servlet组件SpringFrameworkServletServlet无ServletContext生命周期ServletRequest生命周期ReqHttpSession生命周期异步上下文ServletServlet方传统方注解方编程方Servletweb.xml部署<servlet>+<servlet-mapFilterweb.xml部署<filter>+<filter-map*Listenerweb.xml部署<?xml<?xmlversion="1.0"encoding="UTF-<web-appplete="true""/xml/ns/javaee<context-Spring配置文件路该参数值将被org.springframework.web.context.ContextLoaderListener使<param-name>contextConfigLocation</param-<param-classpath*:/META-INF/spring/spring-</param-</context-org.springframework.web.context.ContextLoaderListener为可选申明<listener-class>org.springframework.web.context.ContextLoaderListener</listener-</web-SpringServlet理 生命周初始化:服务:销毁:理
理 生命周初始化:销毁:Servlet异步 SpringBootServletSpringBoot嵌入式Servlet容器限Servlet兼容解决方不支RegistrationBean或@Bean不支@WebServlet有限支依 87.2ConvertanExistingApplicationtoSpringBootyoumayneedtoaddsomeconfigurationto,as
context,byrecingthoseelementsfromA@BeanoftypeServlet
installsthatbeaninthecontainerasifitwere
and<servlet-map/>inweb.xmlA@BeanoftypeFilterorFilterRegistrationBeanbehavessimilarly(asmap/>AnApplicationContextinanXMLfilecanbeaddedthrough
in Alternatively,simplecaseswhereannotationconfigurationisheavilyusedalreadycanberecreatedinafewlinesas 27.4.2ServletContextEmbeddedservletcontainersdonotdirectlyexecutetheServletinterface.ThisisanintentionaldesigndecisionintendedtoreducetheriskthatthirdpartylibrariesdesignedtoruninsideawarmaybreakSpringBootScanningforServlets,Filters,andWhenusinganembeddedcontainer,automaticregistrationofclasses , canbeenabledby SpringBootServlet通 扫描package- 通 通 SpringBoot应用传统Servlet使用Tomcat7插件(Servlet<artifactId>tomcat7-maven-<id>tomcat-<goal>exec-war-<!--ServletContextpath--使用Tomcat8插件(Servlet<!--Tomcat8Maven插件用于构建可执行war<!-- /artifact/org.apache.tomcat.maven/tomcat8-maven-plugin--<artifactId>tomcat8-maven-<version>3.0- <id>tomcat-最终打包成可执行的jar包<goal>exec-war-ServletContext路径tomcat8-maven-plugin所在仓库<name>Alfresco /nexus/content/repositories/p
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2023-2024学年湖南省长沙市高一上学期入学考试英语试题(解析版)
- 成长作文之成长的故事作文教案
- 2024年电能计量配套产品合作协议书
- 2024年汽车冷却风扇项目建议书
- 2024年船用舾装件项目合作计划书
- 2024年防静电海绵项目建议书
- 2024年配电控制设备项目发展计划
- 2024年放射性污染防治项目合作计划书
- 2024年生产L型氨基酸的新酶种项目合作计划书
- 高端医疗区渣土运输服务
- 2024年房产赠与合同范本(31篇)
- 2024年中国移动校园招聘高频难、易错点500题模拟试题附带答案详解
- 《雕梁画栋》课件-2024-2025学年人美版(2024)初中美术七年级上册
- 物理透镜 课件 2024-2025学年苏科版八年级上册物理
- 2024秋四年级英语上册 Unit 5 Dinners ready第2课时(Let's learn Lets play)教案 人教PEP
- 【智慧医疗】医疗健康产业园概念策划方案(XQ)
- 2024年计算机二级WPS考试题库380题(含答案)
- 2024中国移动公司招聘高频500题难、易错点模拟试题附带答案详解
- 2.1 网络改变世界 课件-2024-2025学年统编版道德与法治八年级上册-1
- 青岛市教育局智慧教育中心平台建设方案
- 22G101三维彩色立体图集
评论
0/150
提交评论