Spring Context 관련 import

<%@ page import="
             org.springframework.web.context.*,
             org.springframework.web.context.support.*"%>


Spring WebApplicationContext 가져오기

<%
   ServletContext ctx = pageContext.getServletContext();
   WebApplicationContext wac =
         WebApplicationContextUtils.getRequiredWebApplicationContext(ctx);
%>


Spring Bean 호출하기

// getBean
   XXX xxx = (XXX) wac.getBean("xxx");
   xxx.doSomething();


Posted by KENSIN
,