org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'index.html'
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:474)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:352)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1533)
at org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:317)
at org.apache.velocity.app.Velocity.getTemplate(Velocity.java:378)
at service.HomepageService.updateIndex(HomepageService.java:52)
...
解决办法:加上下面这段即可
String vmPath =ServletActionContext.getRequest().getSession().getServletContext().getRealPath("");
Properties p = new Properties();
p.setProperty("file.resource.loader.path", vmPath+"//");
//初始化vm模板
Velocity.init( p );
Template template=Velocity.getTemplate("index.html","UTF-8");