欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

自定义标签中获取dao

程序员文章站 2022-06-09 13:02:54
...
public static WebApplicationContext getContext(ServletContext context) {
return WebApplicationContextUtils
.getRequiredWebApplicationContext(context);
}

ServletContext context = this.pageContext.getServletContext();
WebApplicationContext webContext = Factory.getContext(context);
advertDAO = (AdvertDAO) webContext.getBean("advertDAO");
相关标签: DAO Java