java - 使用velocity报错
PHP中文网
PHP中文网 2017-04-18 10:27:03
0
3
685

为什么报这个错?


2016-12-04 19:29:29,752 ERROR [http-nio-8080-exec-5] org.apache.velocity - ResourceManager : unable to find resource '/user/logintrack.json.vm' in any resource loader.
2016-12-04 19:30:40,527 ERROR [http-nio-8080-exec-4] org.apache.velocity - ResourceManager : unable to find resource '/user/useraudit.json.vm' in any resource loader.
2016-12-04 19:30:44,208 ERROR [http-nio-8080-exec-7] org.apache.velocity - ResourceManager : unable to find resource '/user/useredit.json.vm' in any resource loader.
2016-12-04 19:30:49,472 ERROR [http-nio-8080-exec-6] org.apache.velocity - ResourceManager : unable to find resource '/user/reset.json.vm' in any resource loader.
2016-12-04 19:30:50,637 ERROR [http-nio-8080-exec-8] org.apache.velocity - ResourceManager : unable to find resource '/user/userlogin.json.vm' in any resource loader.
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
刘奇

Have you configured the resource?

@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
    registry.addResourceHandler("/mystatic/**")
            .addResourceLocations("classpath:/mystatic/");
}
刘奇

After configuration, the front-end returns 200ok, and the back-end will print an error

黄舟

To configure resources.
The simplest thing is to put the velocity file into src/main/resources/templates, and the template file suffix is ​​.vm. Follow springboot default settings

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template