我想创建spring boot web应用程序.
我有两个静态html文件:one.html,two.html.
我想将它们映射如下
localhost:8080/one
localhost:8080/two
Run Code Online (Sandbox Code Playgroud)
不使用模板引擎(Thymeleaf).
怎么做?我已经尝试了很多方法来做到这一点,但我有404错误或500错误(圆形视图路径[one.html]:将调度回当前处理程序URL).
OneController.java是:
@Controller
public class OneController {
@RequestMapping("/one")
public String one() {
return "static/one.html";
}
}
Run Code Online (Sandbox Code Playgroud)
项目结构是