idea+dubbo+zookeeper项目访问html页面的方法

将js,html文件放入consumer的resource的static和template文件中

1 consumer的pom需要引入模板的jar包

  <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
  </dependency> 
 
2 consumer中的application.propertites中添加配置信息
 # 定位模板的目录
spring.thymeleaf.prefix=classpath:/template/
# 给返回的页面添加后缀名
spring.thymeleaf.suffix=.html 
 spring.thymeleaf.mode=LEGACYHTML5
spring.thymeleaf.cache: false  
 
3 需要在controller中配置路由信息
@RequestMapping("/login")
public String login(ModelMap map) {
return "integral";
}
 
原文地址:https://www.cnblogs.com/sunsing123/p/9915275.html