简体   繁体   English

如何在Spring Boot中启用维护模式

[英]How to enable Maintenance mode in spring boot

I'll do some database upgrade. 我将进行一些数据库升级。 I wanted to show a maintenance page to all the user who visit my app when upgrade is going on. 我想向正在进行升级时访问我的应用程序的所有用户显示维护页面。 I wanted to show Maintenance message in all routes. 我想在所有路线上显示维护消息。

Is there a hook to redirect all request to Maintenance page template in spring boot avoiding all the controllers? 是否有一个钩子可以在春季启动时将所有请求重定向到维护页面模板,从而避免使用所有控制器? So that no matter where my user go they will see this Maintenance page. 这样,无论我的用户去哪里,他们都将看到此维护页面。

I couldn't find any resource. 我找不到任何资源。 Any clue will be much appreciated. 任何线索将不胜感激。

This looks like a problem that can be solved by a javax.servlet.Filter. 这看起来像是可以通过javax.servlet.Filter解决的问题。 You can intercept all requests to *.html and forward or redirect to “maintenance.html” 您可以拦截对* .html的所有请求,然后转发或重定向到“ maintenance.html”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM