[Spring]サーブレッドで@Autowiredを使うサンプル
書式
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this));
使用例
public class TestServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Autowired private Service serviceA; public void init(ServletConfig config) throws ServletException { super.init(config); SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this)); assertNotNull("injection service", serviceA) } }