public void destroy() {
// TODO Auto-generated method stub
}
protected final String getModuleConfigPrefix(){
return this.moduleConfig.getPrefix();
}
protected final ActionServlet getActionServlet(){
return this.actionServlet;
}
public String getServletContextAttributeNameForBuffalo(){
return BUFFALO_CONTEXT_PREFIX;
}
public String getServletContextAttributeNameForSCP(){
return SERVLET_CONTEXT_PREFIX+getModuleConfigPrefix();
}
public void init(ActionServlet as, ModuleConfig mc)
throws ServletException {
// TODO Auto-generated method stub
log.info("BuffaloPlugIn init begin ......");
this.actionServlet = as;
this.moduleConfig = mc;
as.getServletContext().setAttribute (getServletContextAttributeNameForBuffalo(),getServletContextAttributeNameForSCP());
log.info("init end ");
}
}
把Buffalo中的SpringFactory和SpringUtil的获得WebApplicationContext的方式修改如下:
在SpringUtil中增加方法:
/**
* 获取WebApplicationContext
* @param context
* @return
*/
public static WebApplicationContext getWebApplicationContext(ServletContext context){