|
楼主 |
发表于 2015-8-12 16:03:05
|
显示全部楼层
楼主你好 电话和我说了一个方案
配置过滤器 过滤上传的ACTION 获取requset请求 在过滤器中调用加密接口 下面是过滤器代码
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
// TODO Auto-generated method stub
// place your code here
System.out.println("过滤器doFilter");
request.setCharacterEncoding("UTF-8");
InputStream inStream = (InputStream)request.getInputStream();
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
byte[] buff = new byte[100];
int rc = 0;
while ((rc = inStream.read(buff, 0, 100)) > 0) {
swapStream.write(buff, 0, rc);
}
byte[] in2b = swapStream.toByteArray();
System.out.println("---------"+in2b.length);
retInStream=这个地方是调用接口返回的加密流文件
我如何能把retInStream流写在request请求里啊 帮个忙吧 我资料没有查到
swapStream.close();
chain.doFilter(request,response);
|
|