- 1、本文档共322页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
[管理学]JAVA培训讲义
* * * * * * * * * * * * * * * * * Servlet Life Cycle Overview ? The Web container manages the life cycle of a servlet instance. These methods should not be called by your code. ? You can provide an implementation of these methods to manipulate the servlet instance or the resources it depends on. * The init Life Cycle Method ? The init method is called by the Web container when the servlet instance is first created. ? The Servlet specification guarantees that no requests will be processed by this servlet until the init method has completed. ? Override the init method when: ? You need to create or open any servlet-specific resources that you need for processing user requests ? You need to initialize the state of the servlet * The service Life Cycle Method ? The service method is called by the Web container to process a user request. ? The HttpServlet class implements the service method by dispatching to doGet, doPost, and so on depending on the HTTP request method (GET, POST, and so on). * * The ServletConfig API * The ServletConfig API ? The GenericServlet class implements the ServletConfig interface, which provides subclasses with direct access to the config delegate. ? The Web container calls the init(config) method, which is handled by the GenericServlet class. This method stores the config object (delegate) and then calls the init() method. ? Override the init() method in your servlet class. Do not override the init(config) method. ? The getInitParameter method provides the servlet with access to the initialization parameters for that servlet instance. These parameters are stored in the deployment descriptor. * * * * * * * 28 29 30 32 33 34 35 42 43 44 45 * * * * * * * * * * * * * * * * Servlets on theWeb Server Deployment diagram of a Web server with a Web container: * Execution of Java Servlets How servlets work with one request: * Execution of Java Servlets How servlets work with many requests: * Advantages and Disadvantages of Java Servlets ? Servlet
您可能关注的文档
最近下载
- 必威体育精装版最全安全法律法规标准辨识清单(2024年2月).docx VIP
- 地面振动传播和衰减的计算.docx VIP
- YZT0182-2022 寄递无人车技术要求.docx
- 某某医院改善就医感受提升患者体验工作方案.docx
- Q_GDW 1234.1-2014 电动汽车充电接口规范 第1部分:通用要求.PDF
- 矛盾调解人民调解方法及调节技巧培训讲座PPT课件.pptx
- 2024年贵州省脱贫帮扶知识参考试题库资料(含答案).pdf
- QX_T 448-2018农业气象观测规范 油菜.pdf
- 高空抛物监控解决方案.pptx
- Q_GDW 1234.3-2014 电动汽车充电接口规范 第3部分:直流充电接口.PDF
文档评论(0)