/**
* 读取图片
* @param request
* @param record
* @return
*/
@RequestMapping(params ="method=queryWlmxZp")
public void queryWlmxZp(HttpServletRequest request,HttpServletResponse response,HttpWlmxZpBean record){
OutputStream outputStream = null;
try {
record =wSWlmxZpService.queryWlmxZp(record);
if(record!=null&&record.getZp().length>0){
byte [] zp=record.getZp();
outputStream = response.getOutputStream();
outputStream.write(zp);
}else{
RequestDispatcher dis = request.getRequestDispatcher("/static/images/timg.jpg");
dis.forward(request, response);
}
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
if(outputStream!=null){
outputStream.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
相关文章
- java上传图片到nginx图片服务器浏览显示403
- JAVA流在页面上显示图片
- vue + vuelazyload图片懒加载 + 显示默认图片 (视频门户网站)
- 在路上遇到的小坑 ----------------------v-lazy加载图片失败 不显示默认图片
- asp.net页面中实现如果图片不存在则显示默认图片
- 使用Java绘制图片边框,解决微信小程序map组件中marker与label层级关系问题,label增加外边框后显示不能置与marker上面
- 【转】关于web项目中的图片上传、并在前端显示问题(tomcat中配置文件上传虚拟路径)
- 使用freemaker 导出word 含多张图片,若无图片则显示文本信息
- .net 反射访问私有变量和私有方法 如何创建C# Closure ? C# 批量生成随机密码,必须包含数字和字母,并用加密算法加密 C#中的foreach和yield 数组为什么可以使用linq查询 C#中的 具名参数 和 可选参数 显示实现接口 异步CTP(Async CTP)为什么那样工作? C#多线程基础,适合新手了解 C#加快Bitmap的访问速度 C#实现对图片文件的压
- 掷骰子-IOS新手项目练习(抱歉,由于个人原因,图片没显示,要源码的项目私聊)