phi*_*611 1 java spring spring-mvc
我是Spring的新手,我觉得很难进入它.我想提供一个静态index.html,但它不起作用.
我使用本教程但无法访问index.html: http:// localhost:8080 /或 http:// localhost:8080/src/main/public/index.html
IndexHtmlController:
package de.phip1611.springboot_test_1;
import org.springframework.stereotype.Controller;
@Controller
public class IndexHtmlController {}
// due to https://spring.io/blog/2013/12/19/serving-static-web-content-with-spring-boot
// this should be enough..
Run Code Online (Sandbox Code Playgroud)
你能尝试以下方法:
index.html到src/main/resources/static文件夹server.contextPath为/.(即server.contextPath=/)| 归档时间: |
|
| 查看次数: |
3312 次 |
| 最近记录: |