springmvc下servlet怎么获取service及调用service的方法

如题所述

第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);本回答被提问者和网友采纳

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网