/**
*
*实现文件下载
*
**/
public ActionForward downLoad(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
Integer docId=(Integer)request.getAttribute("docId");
Document doc=manager.searchDocument(docId, this.checkUser(request).getId());
byte[] content=doc.getContent();
response.reset();
response.setContentType("application/x-download;charset=GBK");
response.setHeader("content-disposition", "attachment;filename="+doc.getTitle());
response.getOutputStream().write(content);
response.getOutputStream().flush();
response.getOutputStream().close();
return null;
}