下载方法:
@RequestMapping(value = "/download.htm")
public void downLoadFile(String id,HttpServletResponse res){
if(){
}else{
res.setContentType("text/html; charset=UTF-8");//注意text/html,和application/html
res.getWriter().print("<html><body><script type='text/javascript'>alert('无权下载文件!');</script></body></html>");
res.getWriter().close();
}
}