캠핑과 개발

service 호출 +1
ServletContext ctx = pageContext.getServletContext();
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(ctx);
NoticeService noticeServie = (NoticeService)wac.getBean("noticeService");

그외..

ApplicationContext
 
String[] configLocation = new String[]{"config/applicationContext.xml",
                   "confg/mvc-applicationContext.xml" };
 ApplicationContext context = new ClassPathXmlApplicationContext(configLocation);
 AccessHistoryService accessHistoryService = (AccessHistoryService)context.getBean("accessHistoryService");

BeanFactory
Resource r = new FileSystemResource("/WEB-INF/conf/applicationContext.xml");
//Resource r = new ClassPathResource("conf/applicationContext.xml");
BeanFactory f = new XmlBeanFactory(r);
AccessHistoryService accessHistoryService = (AccessHistoryService)f.getBean("accessHistoryService");