jsp阶段
<img id="img" src="${ctx }/phone/getImg.ce?type=2&PATHID='+pathid+'"> </img>
java Controller阶段
@RequestMapping("getImg")
@ResponseBody
public String getImg(HttpServletRequest request, HttpServletResponse response) throws Exception {
Map<String, Object> map = getPageMapParams();
List<Map<String, Object>> list_new =xcxQqandWxServices.getimgOraudiopath(map);//通过前端传来的id获取该图片的路径
String path = (String)list_new.get(0).get("NEWFILEPATH");
if (path!=null) {
File file = new File(path);
// 路径为文件且不为空
if (file.isFile() && file.exists()) {
ServletOutputStream out = null;
FileInputStream ips = null;
try {
//获取图片存放路径