码迷,mamicode.com
首页 > Web开发 > 详细

HttpServletRequest 的使用

时间:2015-07-29 18:44:51      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

1. 从HttpServletRequest中读取请求参数

InputStream inStream = request.getInputStream();

ByteArrayOutputStream outSteam = new ByteArrayOutputStream();

byte[] buffer = new byte[1024];

int len = 0;

while ((len = inStream.read(buffer)) != -1) {

  outSteam.write(buffer, 0, len);

}

System.out.println("~~~~~~~~~~~~~~~~付款成功~~~~~~~~~");

outSteam.close();

inStream.close();

String result  = new String(outSteam.toByteArray(),"utf-8"); 

 

  

HttpServletRequest 的使用

标签:

原文地址:http://www.cnblogs.com/ytfcz/p/4686591.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!