@RequestMapping(value="refresh")
@ResponseBody
public void refresh(HttpServletRequest request){
/*XmlWebApplicationContext context1 = (XmlWebApplicationContext)WebApplicationContextUtils.getWebApplicationContext((request.getSession().getServletContext()));
context1.refresh();*/
/**
* Interface to provide configuration for a web application. This is read-only while
* the application is running, but may be reloaded if the implementation supports this.
*
* 用于为Web应用程序提供配置的接口。在应用程序运行时,这是只读的,但如果实现支持此操作,则可以重新加载应用程序。
*/
WebApplicationContext context = WebApplicationContextUtils .getWebApplicationContext(request.getSession().getServletContext());
/**
* Central interface to provide configuration for an application.
* This is read-only while the application is running, but may be
* reloaded if the implementation supports this.
*
* 为应用程序提供配置的中央接口。在应用程序运行时,这是只读的,但如果实现支持此操作,则可能被重新加载。
*
*/
ApplicationContext parent = context.getParent();
if (parent !=null) {
((AbstractRefreshableApplicationContext) parent) .refresh();
}
((AbstractRefreshableApplicationContext) context).refresh();
}