@Override
public void contextInitialized(ServletContextEvent servletContextEvent) {
WebApplicationContext webApplicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContextEvent.getServletContext());
AutowireCapableBeanFactory autowireCapableBeanFactory=webApplicationContext.getAutowireCapableBeanFactory();
autowireCapableBeanFactory.autowireBean(this);
//Permitirmos varias "locations" en el parámetro separados por "\n"
String[] rawLocations = (servletContextEvent.getServletContext().getInitParameter("databasemigration.location")+"").split("\\n");
List<String> locations = new ArrayList<String>();
for(String location : rawLocations) {
if ((location!=null) && (location.trim().isEmpty()==false)) {
locations.add(location);
}
}
databaseMigration.migrate(locations);
}
DatabaseMigrateContextListener.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:ix3
作者:
评论列表
文章目录