摘要: * 文件下载需求: 1. 页面显示超链接 2. 点击超链接后弹出下载提示框 3. 完成图片文件下载 * 分析: 1. 超链接指向的资源如果能够被浏览器解析,则在浏览器中展示,如果不能解析,则弹出下载提示框。不满足需求 2. 任何资源都必须弹出下载提示框 3. 使用响应头设置资源的打开方式: * co 阅读全文
posted @ 2021-05-15 10:10 刘老中医写代码 阅读(46) 评论(0) 推荐(0) 编辑
摘要: ServletContext对象: 1.概念:代表整个web应用,可以和程序的容器(服务器)来通信。 2.获取: 1. 通过request对象获取 request.getServletContext(); 2. 通过HttpServlet获取 this.getServletContext(); im 阅读全文
posted @ 2021-05-15 09:54 刘老中医写代码 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 1. 请求消息:客户端发送给服务器端的数据 * 数据格式: 1. 请求行 2. 请求头 3. 请求空行 4. 请求体 GET /test/response01 HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (Windows NT 10.0 阅读全文
posted @ 2021-05-15 09:33 刘老中医写代码 阅读(97) 评论(0) 推荐(0) 编辑