一:搭建检索服务
1.在search包下的pom文件引入themeleaf模板
<!--引入thymeleaf模板引擎-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
2.引入静态页面
3.在服务器引入静态资源
cd /mydata/nginx/html/static #进入static文件夹
mkdir search #新建search包
4.配置gulimail.conf文件
cd /mydata/nginx/conf/conf.d
#进入到conf.d文件夹
vi gulimail.conf
#编辑文件
server {
listen 81;
server_name gulimail.com *.gulimail.com;
}
5.配置网关
spring:
cloud:
gateway:
routes:
- id: gulimail_search_route
uri: lb://gulimail-search
predicates:
- Host=search.gulimail.com
6.检索服务首页回显
二:调整页面跳转
1.加上热启动配置文件
<!--热启动配置文件-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
2.关闭themeleaf缓存
# 关闭thymeleaf缓存
spring.thymeleaf.cache=false
3.在controller包下新建SearchController类
@GetMapping("/list.html")
public String listPage(){
return "list";
}
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之家整理,本文链接:https://www.bmabk.com/index.php/post/84101.html