简体   繁体   English

维护期间更改Java EE应用程序上的欢迎页面

[英]Change welcome page on Java EE application during maintenance

I need to show a message to users like : "The application will be down for two hours". 我需要向用户显示一条消息,例如:“应用程序将关闭两个小时”。 Until now I rename my index.htm , my login.jsp and I uploaded another index.html with that message. 到目前为止,我重命名了index.htmlogin.jsp并使用该消息上传了另一个index.html Also I upload another html page pointing to my renamed login.jsp to let me in. Is there any other way to do that, more simple? 另外,我还上传了另一个指向我重命名的login.jsp html页面,以便让我进入。还有其他方法可以更简单吗?

My application server is SunONE 6.1 我的应用程序服务器是SunONE 6.1

Web Application contains a file named web.xml also called Deployment Descriptor. Web应用程序包含一个名为web.xml的文件,也称为Deployment Descriptor。

It contains below tag which will be default executed. 它包含下面的标签,将默认执行。

<welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
</welcome-file-list>

You can change default wel-come file list for maintenance hours and restart Web Server. 您可以更改维护时间的默认欢迎文件列表,然后重新启动Web Server。

Define a default landing page in deployment descriptor file. 在部署描述符文件中定义默认登录页面。 When any visitor visits your page it should land on that page. 当任何访问者访问您的页面时,它都应该登陆该页面。 Don't provide any link to navigate to other pages. 不要提供任何链接来导航到其他页面。

If you want to achieve something like this question then you can follow the responses. 如果您想实现类似此问题的解决方案,则可以按照回答进行操作。

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

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