8

I develop and maintain small intranet web apps written in JSP and Java. They run on a Resin web server, without dedicated httpd like Apache.

Before performing maintenance, I activate a very simple Ajax message to urge users to logout.

What I want is, while I do maintenance, a user trying to log in to that particular app to see a "Sorry, temporarily out of service" page, while all other web apps running on the same web server are available as usual.

What are some best practices in this situation?

ulm
  • 123
  • 2
  • 9

3 Answers3

6

Setup an alternate site on your webserver with the outage message. Then when doing maintenance, redirect your website to the maintenance site while up update it. That way if users have pages other than the default page bookmarked, they will still get the outage message. Otherwise, a simple approach is to just swap out your default/login page with a maintenance page.

Annagram
  • 700
  • 7
  • 16
  • Thank you for answer. My web apps have index.jsp which redirects access to main page, like
    
    
    
    
    So, swapping default page and redirecting to other page amounts to the same thing.
    – ulm Oct 19 '08 at 03:12
1

I just swap out the first page of the web app with a linkless page containing the message you mentioned.

MetaGuru
  • 42,847
  • 67
  • 188
  • 294
  • Thank you for rapid answer. Swapping "index.jsp" is a quick and simple solution. I was wondering what everyone out there is doing. – ulm Oct 19 '08 at 02:57
1

on my asp.net page i use the global.asax file, this allows me to check website status in each page request. So if I have put it in maintainance mode or the database is down it redirects to a website offline message.

I would think you could achieve a similar thing with jsp to run an arbitary part of code on each http request to check the status however you may indicate it.

PeteT
  • 18,754
  • 26
  • 95
  • 132
  • Thank you for suggestion. I've got no experience with Asp.net. Perhaps many java web-app frameworks would have such functionality, but in this case I've rolled my own (for the sake of learning Java web-app) so I don't have ready-made solution. – ulm Oct 19 '08 at 03:08