users@glassfish.java.net

Re: Putting up a "maintenance" placeholder page while upgrading an application

From: Dominik Dorn <dominik.dorn_at_gmail.com>
Date: Fri, 8 Jan 2010 14:13:16 +0100

You could do this by writing your own filter which
maps to /* and is before the RackFilter in the filter chain.

In this filter you could test some expression (query db/test file
exists/etc. )
and show the page you want.

Make sure you use the right HTTP response code so that
the search robots don't remove the pages from the index (I think its 550
temporarly unavailable
or something like that)

Greetings,
Dominik


On Fri, Jan 8, 2010 at 11:19 AM, Mathijs Kwik <bluescreen303_at_gmail.com>wrote:

> Hi all,
>
> I'm deploying ruby/rails applications using warbler.
> When upgrading an application (changing database scheme, or other
> lenghty processes) I would like to put up some page saying "you
> reached the right site, but we're down for some mins" instead of the
> default 404 that disabling an app gives now.
>
> Currently the web.xml files for apps I deploy has this in it:
> <filter>
> <filter-name>RackFilter</filter-name>
> <filter-class>org.jruby.rack.RackFilter</filter-class>
> </filter>
> <filter-mapping>
> <filter-name>RackFilter</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
>
> <listener>
>
> <listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class>
> </listener>
>
> Is it possible to have some kind of "check if some file exists and if
> it does, render it and stop processing the request" functionality in
> web.xml ?
>
> Or maybe someone can give me an example of how to do a static, 1 page
> website .war file that gives the same page, no matter what path is
> asked for?
> In that case I can just redeploy that one before a (possibly lengthy)
> upgrade.
>
> Thanks for any help,
> Mathijs
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>


-- 
Dominik Dorn
http://dominikdorn.com