代码是这样的一个简单的请求后台的请求:
/**
* 定向去首页
*
* @return
*/
@RequestMapping("/test")
public String testPage(HttpServletRequest request, HttpServletResponse response) throws Exception {
return "/resource/pages/test";
}
后台报错:
ResourceManager :unable to find resource '/resource/pages/test.vm' in any resource loader
查了下资料,说是velcocity自动配置了,然后把视图后缀自动添加了.vm,但是我没有配置 Velocity:
按照如下更改application.properties
spring.velocity.enabled=false
spring.velocity.checkTemplateLocation=false
spring:
mvc:
view:
prefix:/
suffix:.html
@SpringBootApplication(exclude {DataSourceAutoConfiguration.class,VelocityAutoConfiguration.class})
@ServletComponentScan
public class WebInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(WebInitializer.class);
}
}
均没有效果,在springboot中VelocityAutoConfiguration和spring.velocity.enabled=false
spring.velocity.checkTemplateLocation=false 都已经标识为过期类?有什么好的解决方法吗?
或者说如何给html增加登陆的权限验证?