HttpServletResponse对象(一)
web服务器收到客户端的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象,和代表响应的response对象。
request和response对象既然代表请求和响应,那么我获取客户机提交过来的数据,找request对象,向客户机输出数据,只需要找response对象。
一:HttpServletResponse对象介绍
HttpServletResponse对象代表服务器的响应。这个对象中封装了向客户端发送数据,发送响应头,发送响应状态码的方法。
1.1:负责向客户端(浏览器)发送数据的相关方法
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAzIAAABdCAIAAADxHcRoAAAO0UlEQVR4nO2dPXLruBJGuS7uYbaBdYzzCRhM6qobzRIYvAVM5CpHjlRO7YlcN3PIF0iiKPw0GkBLJK1zynUfBTa6G00S/AaQ/bppmn7//v3r168JGqCGAAAA0Eg3TdNvAAAAAFibkyz7BW1QQwAAAGjkIstWXrbbOdQQAAAAGkGW2UANAQAAoBFkmQ3UEAAAABpBltlADQEAAKCRe8iyw+vX4XbetwGyDAAAABrRyLIv514699K5F/da6v/LuZfu6UMpy8bnl67EviyNyiGoQJYBAABAI3lZdhjfTlLm82Oo0TTfw3NaZn1+uPH7dPz63h+PX9/j4mlpnGVhHBlCkSsFyDIAAABoRLFalhJJWkRZNkuxaTqMH+Op9cs9f8nGeZbG4RCKXClAlm2Bruu8AwAAgB2h+m7ZcW9x1jGnrUb3Pp6O38fX96PB+PzSubfh83t4mvcir2TZsu/0+n7cWDxajs/vZ1n2PYwfw9Mx4pdzb8NnaPzSP7117hJOMPaHELhaDsFP8vOjd/PH7+HptBm6LIimhi382f15/LmR/1LmfDaVlSfFUGYAALA7Cr7yf9oKnDXN+Xtah/GtuyxunUTYYulrIcuCvtdbje/D5/Hwyz1/zacu7cudx8+P/hj02Cgbe0MIzl4NIUhyqdIO4/vw+T08fxyuPZjIsqjKmRv1GshKLcn5hAbrqjRkGQAA7B3Nd8vOAuu4FRhsCC4U2Gy23IW8kmX+ZmLiu2V9VmnNxwpZ5g9hCmXZYgjXSc5K7riYd2dZVqd77ibLbhS3gqgIQ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6/pb1ajw7qjItRAdWr09ud1NKsJL0eqf5qGZYA1zgcNHWNxFfn4r+uqifXkr+XOo35jaDOQLRNxeqJb77K+6qhmtYY4I2vtnt3/MvqdAVIMd4LsqM6LfFGUGcg2i6FZpXoezXXU818qDrXNxQN41DUk0VhO/sthkVT587xrOaxtB9xN6q0K8eIOgORPpE2STta8lgKyJLob43zx1X/dpfi1mL8emvbOHjHf9uvHq/0aOm37aCyUreHuR3AbReurvVgV35Xnobj0usRD1A//jNBnQCwparpSwhUE+oEgAzjTe75BCoIdQLAXUCdAABuUCcAgBvUCQDgBnUCALhJMwAAOEnPMMzzfHUJAAAmWLADALhBnQAAbr4AWdWpW2F4mXgAAAAASUVORK5CYII=" alt="" />
1.4:响应状态码的常量
HttpServletResponse定义了很多状态码的常量,具体查看API
常见的:404
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAuMAAAAxCAIAAAD/djD+AAAGiklEQVR4nO3cMZbbNhCAYZ5Ld8g1eAofIYWKVKn2CH4pVKRMvU1qtS7y3HhvgBQraSkCM5gBQAmg/u+5kEhwMIQAckz6eQohfHx8vL29haGMmDMAAPCaQggfAAAAXbpUKm+jGTFnAADg9VWpPPnhjtOIOQMAAC8qFQAA0C8qFQAA0C8qFQAA0C8qFQAA0K/tKpXz8XA4nrdoHAKVCgAAr8FTqZyPs1JN6HtrpCJTqQAA8Ao8lcpp1p576HtrpCJTqQAA8AqUSuV8PEzTNE3T4XgO4TRPi29fO6f5FKK9n98X9cV1f7KYuWt8mqfD4SBHvkjmPM3vyz/Z7YnhuLb57Y9zfEgywiq4Mb6eZ7zl97//Sx67ytOeCQAAQ1ArldVLl/sN1xJiPqWbL77nH7csGp+Ph/l0t8n29icuKfTPklsFIB0bFxN//ftrWTRY4iufk8WK9NmeJwAAI1Lf/lwenBziiuFaToTTbKpUro0kd6Hny1Ob8kpF36hLVgBK9XDb8nmIMb6+0V51KZWK1BcAAAORK5Wv9ztflcohfimzfh90LWCW74bW74pW7hqf5s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Onr0zeuMnoqQ8cXxu12kUP+pe7VsZWVQtlD1BXcnpQ+aPKUMoTiM9diWEpeZZgx3BoKho63bvOP84M6/zm1ZP9N2u3pL+ZiFCGedVE/mOsnqZnr7D21mKbtxx46ROsz2y2MmZJH9Awboj8pthIclOonMgBsDhsWHoGdvUc290+yB4Am9O9CAOBxYNvC47Cb98gjzIJkDwAAAACwB0j2AAAAAAB7gGQPAAAAALAHSPYAAAAAAHuAZA8AAAAAsAfekz0AAAAAAAzN53f2YzGiZwAAAACA9eDXOAAAAAAAe4BkDwAAAACwB/4HZ/P4m6iYDEsAAAAASUVORK5CYII=" alt="" width="950" />
二:HttpServletResponse对象常见应用
2.1使用outputStream流向客户端输出中文数据
范例:public class ResponseDemo01 extends HttpServlet{
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String data="中国";
OutputStream op=response.getOutputStream();
response.setHeader("content-type", "text/html;charse=GBK");
byte[] dataByteArr=data.getBytes("GBK");
op.write(dataByteArr);
}
}
2.2:使用printwriter流向客户端输出中文数据
public class ResponseDemo01 extends HttpServlet{
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String data="中国";
response.setHeader("content-type", "text/html;charset=GBK");
response.setCharacterEncoding("GBK");
PrintWriter out=response.getWriter();
out.print(data);
}
}
使用printwriter没有将字符串转换成字节数组那一步。
2.3:文件下载
实现的思路::
1.获取要下载的文件的绝对路径
2.获取要下载的文件名
3.设置content-disposition响应头控制浏览器以下载的形式打开文件
4.获取要下载的文件输入流
5.创建数据缓冲区
6.通过response对象获取OutputStream流
7.将FileInputStream流写入到buffer缓冲区
8.使用OutputStream将缓冲区的数据输出到客户端浏览器
代码:
public class ResponseDemo02 extends HttpServlet{
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//1:获取下载文件的绝对路径
String realPath=this.getServletContext().getRealPath("/download/2.jpg");
//2获取下载的文件名
String fileName=realPath.substring(realPath.lastIndexOf("\\")+1);
//3设置content-disposition响应头控制浏览器以下载的形式打开文件
中文文件名要使用URLEncoder.encode方法进行编码,否则会出现文件名乱码
response.setHeader("content-disposition", "attachment;filename="+URLEncoder.encode(fileName, "UTF-8"));
response.setHeader("content-disposition", "attachment;filename="+fileName);
//4:获取要下载的文件输入流
InputStream in=new FileInputStream(realPath);
int len=0;
//5:创建数据缓冲区
byte[] buffer=new byte[1024];
//6通过response对象获取outputStream流
OutputStream out=response.getOutputStream();
//7将fileInputStream流写入到buffer缓冲区
while((len=in.read(buffer))>0){
//8使用outputStream将缓冲区的数据输出到客户端浏览器
out.write(buffer,0,len);
}
in.close();
}
}
第三步是以下载的形式打开文件,然后inputsteam是把内容写入到路径中,然后outputstream输出到客户端展示出来。
文件下载注意事项:编写文件下载功能时推荐使用OutputStream流,避免使用PrintWriter流,因为OutputStream流是字节流,可以处理任意类型的数据,而PrintWriter流是字符流,只能处理字符数据,如果用字符流处理字节数据,会导致数据丢失。
response实现细节:
getOutputStream和getWriter方法分别用于得到输出二进制数据、输出文本数据的ServletOuputStream、Printwriter对象。
getOutputStream和getWriter这两个方法互相排斥,调用了其中的任何一个方法后,就不能再调用另一方法。
Servlet程序向ServletOutputStream或PrintWriter对象中写入的数据将被Servlet引擎从response里面获取,Servlet引擎将这些数据当作响应消息的正文,然后再与响应状态行和各响应头组合后输出到客户端。
Serlvet的service方法结束后,Servlet引擎将检查getWriter或getOutputStream方法返回的输出流对象是否已经调用过close方法,如果没有,Servlet引擎将调用close方法关闭该输出流对象。
HttpServletResponse对象(一)的更多相关文章
- java web学习总结(七) -------------------HttpServletResponse对象(一)
Web服务器收到客户端的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象.和代表响应的response对象.request和response对象即然代表请求和响应,那我们要 ...
- JAVAWEB学习总结 HttpServletResponse对象(一)
Web服务器收到客户端(浏览器)的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象,和代表响应的response对象. request和response对象既然代表请求和响 ...
- HttpServletResponse对象 学习
Web服务器收到客户端的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象.和代表响应的response对象.request和response对象即然代表请求和响应,那我们要 ...
- JavaWeb---总结(七)HttpServletResponse对象(一)
Web服务器收到客户端的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象.和代表响应的response对象. request和response对象即然代表请求和响应,那我们 ...
- javaweb学习总结(七)——HttpServletResponse对象(一)
Web服务器收到客户端的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象.和代表响应的response对象.request和response对象即然代表请求和响应,那我们要 ...
- 三HttpServletResponse对象介绍(1)
转载自http://www.cnblogs.com/xdp-gacl/p/3789624.html Web服务器收到客户端的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象 ...
- java web 学习七(HttpServletResponse对象1)
Web服务器收到客户端的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象.和代表响应的response对象.request和response对象即然代表请求和响应,那我们要 ...
- javaweb笔记6多个响应头以及 HttpServletResponse对象
1 常见的响应头 Location: http://www.it315.org/index.jsp 重定向的地址.配合302的状态码一起使用,实现重定向效果. Content-Type: te ...
- HttpServletRequest对象请求转发和HttpServletResponse对象请求重定向之间的区别
HttpServletRequest对象request代表浏览器请求对象,HttpServletResponse对象代表服务器响应对象,当用浏览器访问web服务器,发出请求时,Servlet调用ser ...
- javaweb学习总结(七)——HttpServletResponse对象(一)(转)
Web服务器收到客户端的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象.和代表响应的response对象. request和response对象即然代表请求和响应,那我们 ...
随机推荐
- tar命令结合find搜索将指定条件的文件进行打包压缩
今天处理 /tmp 临时目录下 session 文件过多的问题,顺便找到了这个 tar 结合 find 打包压缩的方法,记录下来,很实用的哈! 搜索 /tmp 目录下 创建超过 24 分钟的文件 fi ...
- hdu1033
#include<stdio.h> #include<string.h> const int MAXN=200; char str[MAXN]; int main() { in ...
- Jasper_style
(1) text field <style name="Header" forecolor="#FFFFFF" backcolor="#002D ...
- iOS SDWebImage的使用
现在把代码贴出来,供大家参考.尤其是新手,看完这篇博客,图片缓存so easy.最后有demo供大家下载,先学习. 第一步,下载SDWebImage,导入工程.github托管地址https://gi ...
- KMP 算法 学习 整理
我自己整理的KMP算法的PDF文件:http://pan.baidu.com/s/1o8yKIi2提取密码:8291 别的就不多说啥了,感谢来自海子 博客园的 资料--
- JavaScript忍者秘籍——运行时代码求值
1. 代码求值机制 JavaScript中,有很多不同的代码求值机制. ● eval()函数 ● 函数构造器 ● 定时器 ● <script>元素 - 用eval()方法进行求值 作为定义 ...
- [SOJ] DAG?
Description 输入一个有向图,判断该图是否是有向无环图(Directed Acyclic Graph). Input 输入的第一行包含两个整数n和m,n是图的顶点数,m是边数.1<=n ...
- 一个挺好用的任务提示小软件 Rainlendar2
Rainlendar2 可以把任务列出来放到桌面上.
- Windows Server 2008 如何在IIS中添加MIME类型
用户可以通过使用MIME以设置服务器传送多媒体文件,如声音和视频等.MIME是一种技术规范,现在可以用于浏览器上,传送可以供浏览器识别的信息 如果我们的网站提供下载服务,有时传上去的文件比如 xxx. ...
- 如何设置linux的文件和目录的权限
1 字符表示法 1)chmod [-R] 权限(mode)file 注:[-R]会将目录下所有权限都设置成指定的 who operator permission u(owner) +增加权限 r( ...