当前位置:网站首页>Talking about Servlet
Talking about Servlet
2022-07-29 05:33:00 【Xiao Hong is working hard】
What is? Servlet?
Simply speaking Servlet yes java Write a server-side program , Running on the web Server , It is a component of dynamic web pages spliced by different users .
Servlet What's the role ?
- Receive the request from the client
- Call other java Program to process requests
- Will deal with the result , Return to the server
Servlet How to create ?
1、 Create class inheritance HttpServlet
2、 Override unimplemented methods –service Method
Servlet Life cycle of ( a key )
We study Servlet The life cycle of mainly studies the following points :
Construction method :
- establish servlet Object . By default , First visit to this servlet Call the constructor to create an object . The constructor is called only once ,servlet The object is tomcat Is a singleton .
init(); Method :
- Created servlet Object . Just call 1 Time .
service();:
- Call this method every time the browser makes a request . Callable n Time .
destory();
- The destruction servlet Object . for example : Stop the server or redeploy web Destroy when applying servlet object . Call it once .
边栏推荐
猜你喜欢
阿里云联合鼎捷软件发布云上数字工厂解决方案,实现云MES系统本地化部署
省市区三级联动(简单又完美)
Alibaba cloud architect details nine trends in the game industry
哈夫曼树以及哈夫曼编码在文件压缩上的应用
一维数组练习
阿里云张新涛:异构计算为数字经济提供澎湃动力
MySQL的基础概念+数据库系统结构+拓展延申+基础命令学习
力扣994:腐烂的橘子(BFS)
Live broadcast Preview: integration of JD cloud Devops and jfrog product library
510000 prize pool invites you to fight! The second Alibaba cloud ECS cloudbuild developer competition is coming
随机推荐
刷题狂魔—LeetCode之剑指offer58 - II. 左旋转字符串 详解
365 day challenge leetcode 1000 questions - day 040 design jump table + avoid flooding + find the latest grouping with size M + color ball with reduced sales value
Day 3
VIM editor use
副作用和序列点
PyQt5:第一章第1节:使用Qt组件创建一个用户界面-介绍
实现简单的数据库查询(不完整)
适创科技以云仿真平台,支持“中国智造”升级
Time complexity and space complexity
365 day challenge leetcode 1000 questions - day 042 array sequence number conversion + relative ranking discretization processing
Day 3
EXIT中断详解
Day 2
Storage category
浅谈范式
关于局部变量
【C语言系列】— 把同学弄糊涂的 “常量” 与 “变量”
Summary of the first week
三次握手四次挥手针对面试总结
【C语言系列】— 一道递归小题目