如题所述
第1个回答 2015-05-05
您好,您这样:
WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
INewsAttachService newsAttachService = (INewsAttachService) context.getBean("newsAttachService");
NewsAttach attach = new NewsAttach();
attach.setAttach_Name(item.getName());
attach.setAttach_real_path(uploadFileName);
attach.setResource_id(r_id);
attach.setAttach_path(attachUploadPath+"/"+saveFileName);
newsAttachService.save(attach);本回答被提问者和网友采纳
WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
INewsAttachService newsAttachService = (INewsAttachService) context.getBean("newsAttachService");
NewsAttach attach = new NewsAttach();
attach.setAttach_Name(item.getName());
attach.setAttach_real_path(uploadFileName);
attach.setResource_id(r_id);
attach.setAttach_path(attachUploadPath+"/"+saveFileName);
newsAttachService.save(attach);本回答被提问者和网友采纳