springMvc 處理HttpRepsonse時 同時設置response.setStatus(301)和response.sendRedirect("/hello");時,HTTP response Headers status is 302調換兩個的位置也是如此,所以想理解下具體的原理相關代碼 //input
response.sendRedirect("/hello"); response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);// outputRequest URL: http://localhost:9999/account/listRequest Method: GET
Status Code: 302 Remote Address: [::1]:9999Referrer Policy: no-referrer-when-downgrade
HTTP/1.1 302Location: http://localhost:9999/helloContent-Length: 0Date: Sun, 29 Jul 2018 17:38:31 GMT
- 2 回答
- 0 關注
- 1380 瀏覽
相關問題推薦
添加回答
舉報
0/150
提交
取消