You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2008/12/15 23:41:19 UTC

T5: a default notification page

Hi,
Often I need to shutdown tomcat in order to do some maintenance work, is
there a way to define a page in a T5 application so that all links to the
application goes to that page? thanks.

Angelo
-- 
View this message in context: http://www.nabble.com/T5%3A-a-default-notification-page-tp21023653p21023653.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: a default notification page

Posted by Olle Hallin <ol...@gmail.com>.
I think that you can do this with Apache mod_rewrite and use the presence of
a certain file as an indicator that the site is in maintenance mode.

Search for the ContPattern -F in
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

This will make it extremely simple to maintain. The backup script starts by
touching a certain well-known file that mod_rewrite looks for, and
ends by removing that file. The down-side is that the mod_rewrite -F
conditional affects performance negatively.

Should you need to put the site in maintenance mode for other reasons, just
touch the marker file manually.

HTH,
Olle


2008/12/16 Angelo Chen <an...@yahoo.com.hk>

>
> Thanks to all replies, I think good idea to have Apache in front of tomcat.
> a
> related question is, say you need to backup the database at certain time in
> a day, this has to be automated, you can't manually pointing the page to
> another location, any good practice on this? I'm thinking of putting a
> dispatcher, and a global variable, when it is set, all the page will be
> redirected in the dispatcher to a 'maintenance page' until the backup is
> done which will set the global variable to false and the dispatcher again
> will not redirect anything, what do you think?
>
>
> Angelo Chen wrote:
> >
> > Hi,
> > Often I need to shutdown tomcat in order to do some maintenance work, is
> > there a way to define a page in a T5 application so that all links to the
> > application goes to that page? thanks.
> >
> > Angelo
> >
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-a-default-notification-page-tp21023653p21029929.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hallin@crisp.se
www.crisp.se

Re: T5: a default notification page

Posted by Angelo Chen <an...@yahoo.com.hk>.
Thanks to all replies, I think good idea to have Apache in front of tomcat. a
related question is, say you need to backup the database at certain time in
a day, this has to be automated, you can't manually pointing the page to
another location, any good practice on this? I'm thinking of putting a
dispatcher, and a global variable, when it is set, all the page will be
redirected in the dispatcher to a 'maintenance page' until the backup is
done which will set the global variable to false and the dispatcher again
will not redirect anything, what do you think?


Angelo Chen wrote:
> 
> Hi,
> Often I need to shutdown tomcat in order to do some maintenance work, is
> there a way to define a page in a T5 application so that all links to the
> application goes to that page? thanks.
> 
> Angelo
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-a-default-notification-page-tp21023653p21029929.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: a default notification page

Posted by Andreas Andreou <an...@gmail.com>.
if you shutdown tomcat, tapestry app wont be running ;)

If you have apache setup in front of tomcat, you can add redirect
rules to a static html page
see http://significantbits.wordpress.com/2007/03/15/setting-a-maintenance-page-in-apache-2/
or similar
posts

On Tue, Dec 16, 2008 at 1:50 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> Em Mon, 15 Dec 2008 19:41:19 -0300, Angelo Chen <an...@yahoo.com.hk>
> escreveu:
>
>> Hi,
>> Often I need to shutdown tomcat in order to do some maintenance work, is
>> there a way to define a page in a T5 application so that all links to the
>> application goes to that page? thanks.
>
> I haven't tested, but maybe you can decorate
> ComponentClassResolver.resolvePageNameToClassName() and
> ComponentClassResolver.resolvePageClassNameToPageName() to always return
> your application-out-of-order page. The AOP possibilities in Tapestry 5 are
> almost endless . . .
>
>>
>> Angelo
>
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> Consultor, desenvolvedor e instrutor em Java
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: a default notification page

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 15 Dec 2008 19:41:19 -0300, Angelo Chen  
<an...@yahoo.com.hk> escreveu:

> Hi,
> Often I need to shutdown tomcat in order to do some maintenance work, is
> there a way to define a page in a T5 application so that all links to the
> application goes to that page? thanks.

I haven't tested, but maybe you can decorate  
ComponentClassResolver.resolvePageNameToClassName() and
ComponentClassResolver.resolvePageClassNameToPageName() to always return  
your application-out-of-order page. The AOP possibilities in Tapestry 5  
are almost endless . . .

>
> Angelo



-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org