• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Welcome File

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a web application that handles partial URL's by redirecting to a defined welcome file.

My question is how do I use the same strategy if the application is not deployed. Say for example I have to undeploy the application from the server, and a user makes a request for the webapp. How do I display a default "under construction" page?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you undeploy the web app, it doesn't exist and can't serve anything.

The strategy I employ if I need to take an app down for any extended period (meaning anything other than a quick restart), is to stop the app, temporarily change the docbase of the context to a simple web app that presents the "We'll be right back" page, and restart the app.

When it's time to bring the app back up, I stop the app, restore the docbase, and restart.

(Note: I only stop and start the web app, not the entire container).
[ August 08, 2006: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can do it with .htaccess (assuming your apache server is set up to allow this: AllowOverride must be set to the appropriate value).

Suppose your site is www.example.com/myapp and your welcome file is called welcome.html, in the same directory.

Edit the .htaccess in your myapp directory (create the file if it doesn't exist) and add the following:


Now when someone tries to go to http://www.example.com/myapp/lunch/fruit/apple/core.do

they will get the welcome.html file, assuming lunch/fruit/apple/core.do does not exist--when your application is undeployed.

You could put the welcome file in another directory, as long as it can be seen from the web. Note also that it MUST be accessible from the same URL (www.example.com), otherwise you'll get wacky results.

[ August 09, 2006: Message edited by: Rusty Smythe ]
[ August 09, 2006: Message edited by: Rusty Smythe ]
 
Gobind Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Jonas J2EE server.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rusty Smythe:
You can do it with .htaccess (assuming your apache server is set up to allow this:



What led you to believe apache was being used?
 
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic