1 java 架構(gòu) B/S 架構(gòu) C/S 架構(gòu)
2 B/S 的資源類型,靜態(tài)資源和動態(tài)資源
- 靜態(tài) html css js pic
- 動態(tài)資源 servlet
3 servlet 編程
4 網(wǎng)絡模型 TCP/IP 和 邏輯模型
網(wǎng)絡編程三要素
- protocol
- ip
- portnumber
4 網(wǎng)絡連接 ??????
5 單次請求
request ------> server -------->response
request: 請求頭
請求行
請求空行
請求體(get 為空 post 為;字段)
cookie
session
跳轉(zhuǎn)和轉(zhuǎn)發(fā)
route
分解 request
get /index.html http/1.0
host: 127.0.0.1
user-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
accept-language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
accept-encoding: gzip, deflate
referer:
cookie:
connection:
upgrade-insecure-request: 1
其它概念
requestmethod
uri
url
servletpath
servername
portnumber
domain
cookie
session
ip 地址
applicationContext
虛擬目錄
轉(zhuǎn)發(fā)和跳轉(zhuǎn)的區(qū)別
轉(zhuǎn)發(fā) 1次請求 內(nèi)部轉(zhuǎn)發(fā) 地址不發(fā)生變化
跳轉(zhuǎn) 2次請求 可以外部 地址發(fā)生變化
request 在 java 中的
servletRequest
httpServletRequest
請求域 會話域 程序域
6 返回 response
HTTP/1.1 302
Set-Cookie: JSESSIONID=AC10EEE191517A7F34DDC9AFAF178428; Path=/03j2ee_web_day10_003Http_war_exploded; HttpOnly
Set-Cookie: name=value
Location: /03j2ee_web_day10_003Http_war_exploded/movie
Content-Length: 0
Date: Wed, 31 Jul 2019 12:13:43 GMT
協(xié)議/版本 返回碼 返回說明
響應行
conten-Type
Content-Disposition
inline
attachment;filename
響應空行
響應體
狀態(tài)嗎
- 1** 服務器詢問
- 2**
- 3** 301 重定向 302讀緩存
- 4** 404 頁面不存在 405 沒有對應方法