【发布时间】:2020-06-11 18:35:16
【问题描述】:
一旦作为 WAR 部署到 Tomcat 中,我的自定义 SBA 仪表板无法显示最初在 JAR 中运行良好的自定义视图(但现在它也失败了,顺便说一句)
这是扩展的目录在 WAR 中的位置: /WEB-INF/classes/META-INF/spring-boot-admin-server-ui/extensions/customz/...
REM:我还自定义了登录页面,我的图片位于 /WEB-INF/classes/META-INF/spring-boot-admin-server-ui/assets/img/ 所以我猜是类路径不是问题。
不过,我在 Web 浏览器的控制台中遇到了错误:
GET http://xx.xx.xx.xx:8080/extensions/customz/css/custom.fb3a4f29.css net::ERR_ABORTED 404
REM:根据我的上下文路径,正确的路径可能应该是那个:
http://xx.xx.xx.xx:8080/myapp/dashboard/extensions/customz/css/custom.fb3a4f29.css
server.servlet.context-path=/myapp
spring.boot.admin.context-path=/dashboard
...
<packaging>war</packaging>
<build>
<finalName>myapp</finalName>
...
</build>
但在这种情况下,我不知道如何更改视图的基本路径。我应该只需要在系统前面加上我的“customz/dashboard”上下文路径(?)
请问有人知道如何摆脱这个陷阱吗?
注意:Spring Boot 2.2.8、Spring Cloud Hoxton.SR5、SBA 2.2.3、Tomcat 9.0.36
【问题讨论】:
-
今天早上我回到了 Spring Boot 2.2.7 和 Spring Cloud Hoxton.SR4,因为它是 SBA 2.2.3(Tomcat 9.0.34 附带)的基础堆栈
标签: spring-boot customization war spring-boot-admin