标签:x64 safari origin ike demo1 cse gen type lang
1、三个方法
1.1 init :只执行一次
1.2 service :每次都执行
1.3 destory: 关闭时执行一次
XML:配置
<!-- 配置Servlet信息 -->
<servlet>
<servlet-name>demo1</servlet-name>
<servlet-class>cn.itcast.web.servlet.ServletDemo1</servlet-class>
</servlet>
<!-- 配置Servlet映射(访问路径) -->
<servlet-mapping>
<!-- 配置Servlet名称,必须和上面的相同 -->
<servlet-name>demo1</servlet-name>
<!-- 配置虚拟路径(访问路径) -->
<url-pattern>/demo1</url-pattern>
</servlet-mapping>
注解配置:
@WebServlet({"/d4","/dd4","/ddd4"})
@WebServlet("/user/demo4")
@WebServlet("/user/*")
@WebServlet("/*")
@WebServlet("*.do")
另 实现httpservlet
需要实现两个方法:doGet/doPost
servlet接口 ------->GenericServlet抽象类--------->HttpServlet抽象类
2、http协议
请求行 :请求方式 请求URL 协议版本 http/1.1
请求头:
GET /logstores/csdn-pc-tracking-pageview/track_ua.gif?
Host: event.csdn.net
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Content-Type: text/plain;charset=UTF-8
Origin: https://blog.csdn.net
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://blog.csdn.net/qq_33642117/article/details/51850417
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
请i求空行
请求体 :封装POST请求消息的请求参数
标签:x64 safari origin ike demo1 cse gen type lang
原文地址:https://www.cnblogs.com/mocc/p/13252541.html