public ActionForward addOutpatient(ActionMapping mapping,ActionForm form,
HttpServletRequest request,HttpServletResponse response) throws FileNotFoundException, IOException{
OutpatientForm paf = (OutpatientForm) form;
FormFile file = paf.getUploadFile();
FormFile file1 = paf.getUploadFile();
// 得到文件被保存在服务器端的绝对路径(要上传到哪里的路径)
String path = this.getServlet().getServletContext().getRealPath("/uploadFolder");
String path1 = this.getServlet().getServletContext().getRealPath("/pdf");
// 将文件保存在服务器端
String fileName=file.getFileName();//得到文件名称 
String fileName1=file1.getFileName();//得到文件名称 
if(fileName!=null&&!"".equals(fileName)){
Random random = new Random(); 
long rand = random.nextLong();//随机数
String temp = fileName.substring(fileName.lastIndexOf("."), fileName.length());
fileName=rand+temp;
this.save(file.getInputStream(), fileName, path);
}
if(fileName1!=null&&!"".equals(fileName1)){
Random random = new Random(); 
long rand = random.nextLong();//随机数
String temp = fileName1.substring(fileName1.lastIndexOf("."), fileName1.length());
fileName1=rand+temp;
this.save(file1.getInputStream(), fileName1, path1);
}
Outpatient out=new Outpatient();
out.setName(paf.getName());
out.setAddress(paf.getAddress());
out.setProvince(paf.getProvince());
out.setCity(paf.getCity());
out.setArea(paf.getArea());
out.setLinkman(paf.getLinkman());
out.setPhone(paf.getPhone());
out.setLinkman_mobile(paf.getLinkman_mobile());
out.setQq(paf.getQq());
out.setCreateTime(org.tol.util.DateFormat.getDate());
out.setEmail(paf.getEmail());
out.setServiceArea(paf.getServiceArea());
out.setUrl(paf.getUrl());
out.setBeginTime(paf.getBeginTime());
out.setBusLines(paf.getBusLines());
out.setPostcode(paf.getPostcode());
out.setTop(0);
out.setNature(paf.getNature());
out.setType(paf.getType());
out.setGrade(paf.getGrade());
out.setIntroduce(paf.getIntroduce());
out.setImg("/uploadFolder"+"/"+fileName);
out.setPdf("/pdf"+"/"+fileName1);
outpatientBiz.addInfo(out);
System.out.println(out.getImg());
System.out.println(out.getPdf());
String message = "<script>alert('恭喜您!信息添加成功');</script>";
request.setAttribute("message", message);
return new ActionForward("/WEB-INF/manage/manage/addoutpatient.jsp");
}