900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > Springboot访问静态页面

Springboot访问静态页面

时间:2018-09-21 22:00:39

相关推荐

Springboot访问静态页面

# 在application.properties中配置spring.thymeleaf.prefix=classpath:/templates/spring.thymeleaf.suffix=.htmlspring.thymeleaf.encoding=UTF-8spring.thymeleaf.mode=HTML5

在Pom.xml添加依赖<!-- 静态页面跳转--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>

不能用@RestController@Controllerpublic class TestController {@RequestMapping("login")public String hello(){return "login";}}@RequestMapping("hh")public String hh(){return "hah/hee";}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。