You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ionel Gardais <io...@geomath.fr> on 2003/06/25 13:56:38 UTC

delay before redirect

Hi,

is it possible to set a delay before a redirect ?
I'd like to do that in order to display a result page for 5 seconds and 
then go to the welcome page.

I am already using an http-equiv="refresh" with a 300 seconds delay for 
the whole page but I want to bypass it with a redirection after 5 seconds.


thanks,
ionel


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: delay before redirect

Posted by James Mitchell <jm...@apache.org>.
Ok, so add a small script in the body of your page that does it's own (e.g.
overrides) the meta refresh.

Here's what I mean (change to your liking):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
 <title>Test Page</title>
 <meta http-equiv="Refresh" content="300;
URL='javascript:location.reload()'">
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>

 <script>
setTimeout("window.location='?'",5000)
</script>

</body>
</html>





--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org


----- Original Message -----
From: "Ionel Gardais" <io...@geomath.fr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, June 25, 2003 10:47 AM
Subject: Re: delay before redirect


> James Mitchell wrote:
>
> >So what's stopping you from putting this
> >
> ><META HTTP-EQUIV="Refresh" CONTENT="5; URL="<html:rewrite
> >forward="someGlobalForward"/>/">
> >
> >...in the head section of the page?
> >
> >
> I already have a <META HTTP-EQUIV="Refresh" CONTENT="300;
> URL="javascript:location.reload()"> from the Tiles template.
>
> I am only overriding the body frame for each vue. As the meta equiv
> should be placed inside the head tag, I have no way to alter it.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: delay before redirect

Posted by Ionel Gardais <io...@geomath.fr>.
James Mitchell wrote:

>So what's stopping you from putting this
>
><META HTTP-EQUIV="Refresh" CONTENT="5; URL="<html:rewrite
>forward="someGlobalForward"/>/">
>
>...in the head section of the page?
>  
>
I already have a <META HTTP-EQUIV="Refresh" CONTENT="300; 
URL="javascript:location.reload()"> from the Tiles template.

I am only overriding the body frame for each vue. As the meta equiv 
should be placed inside the head tag, I have no way to alter it.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: delay before redirect

Posted by James Mitchell <jm...@apache.org>.
So what's stopping you from putting this

<META HTTP-EQUIV="Refresh" CONTENT="5; URL="<html:rewrite
forward="someGlobalForward"/>/">

...in the head section of the page?


"someGlobalForward" would obviously be a global forward that is the entry
point into the application or as you put it "app root" and might just be
"/index.jsp".


--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org


----- Original Message -----
From: "Ionel Gardais" <io...@geomath.fr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, June 25, 2003 10:00 AM
Subject: Re: delay before redirect


> - the user asks for an edit page.
> - a form is displayed.
> - when the form is filled the user clicks on the validate button.
> - action is called and a server side computation is done.
> - when the computation is completed, a page display a success or failure
> message to the user
>   - on success, the main page should be displayed after 5 seconds
>
> my problem is the whole site uses a tiles template with a autorefresh
> set to 5 minutes (meta refresh URL is javascript:location.reload())
> I would like to override this so the success page is only displayed for
> 5 seconds and the URL to be the app root.
>
> thanks,
> ionel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: delay before redirect

Posted by Ionel Gardais <io...@geomath.fr>.
- the user asks for an edit page.
- a form is displayed.
- when the form is filled the user clicks on the validate button.
- action is called and a server side computation is done.
- when the computation is completed, a page display a success or failure 
message to the user
  - on success, the main page should be displayed after 5 seconds

my problem is the whole site uses a tiles template with a autorefresh 
set to 5 minutes (meta refresh URL is javascript:location.reload())
I would like to override this so the success page is only displayed for 
5 seconds and the URL to be the app root.

thanks,
ionel


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: delay before redirect

Posted by James Mitchell <jm...@apache.org>.
What's the use case here?  What are you trying to do with your app?

--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org


----- Original Message ----- 
From: "Ionel Gardais" <io...@geomath.fr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, June 25, 2003 9:09 AM
Subject: Re: delay before redirect


> Hi James,
> 
> Thanks for the reply.
> Can I had another refresh equiv in addition to the first ? (I would then 
> get two meta refresh, one set at 5 minutes and one at 5 seconds)
> The first meta refresh is hard coded in the tiles template I use for my 
> pages that's why I am looking for something to override it.
> 
> BTW, I don't think Filip is a french talker (he is the one who asked 
> about your 2-cent bet) ;-)
> 
> 
> thanks,
> ionel
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: delay before redirect

Posted by Ionel Gardais <io...@geomath.fr>.
Hi James,

Thanks for the reply.
Can I had another refresh equiv in addition to the first ? (I would then 
get two meta refresh, one set at 5 minutes and one at 5 seconds)
The first meta refresh is hard coded in the tiles template I use for my 
pages that's why I am looking for something to override it.

BTW, I don't think Filip is a french talker (he is the one who asked 
about your 2-cent bet) ;-)


thanks,
ionel


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: delay before redirect

Posted by James Mitchell <jm...@apache.org>.
 C'est une énonciation commune.  En donnant un rapport qui est seulement de
mon propre avis, je donne ma valeur de 2 cents à la matière.


--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org


----- Original Message -----
From: "Filip Polsakiewicz" <Fi...@innoface.de>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, June 25, 2003 9:06 AM
Subject: RE: delay before redirect


>
>
> > -----Original Message-----
> > From: James Mitchell [mailto:jmitchell@apache.org]
> > Sent: Wednesday, June 25, 2003 3:01 PM
> > To: Struts Users Mailing List
> > Subject: Re: delay before redirect
> >
> >
> > I would suggest staying with the meta tag approach.  This lessens
> > the burden
> > on the container and let's them (basically) poll your app in the
> > case where
> > they are waiting for some asynchronous process to complete.
>
> What does
>
> >
> > Just my $.02
>
> mean?
>
> Filip
> >
> > --
> > James Mitchell
> > Software Developer/Struts Evangelist
> > http://www.struts-atlanta.org
> >
> >
> > ----- Original Message -----
> > From: "Ionel Gardais" <io...@geomath.fr>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Wednesday, June 25, 2003 7:56 AM
> > Subject: delay before redirect
> >
> >
> > > Hi,
> > >
> > > is it possible to set a delay before a redirect ?
> > > I'd like to do that in order to display a result page for 5 seconds
and
> > > then go to the welcome page.
> > >
> > > I am already using an http-equiv="refresh" with a 300 seconds delay
for
> > > the whole page but I want to bypass it with a redirection after
> > 5 seconds.
> > >
> > >
> > > thanks,
> > > ionel
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: delay before redirect

Posted by Filip Polsakiewicz <Fi...@innoface.de>.

> -----Original Message-----
> From: James Mitchell [mailto:jmitchell@apache.org]
> Sent: Wednesday, June 25, 2003 3:01 PM
> To: Struts Users Mailing List
> Subject: Re: delay before redirect
> 
> 
> I would suggest staying with the meta tag approach.  This lessens 
> the burden
> on the container and let's them (basically) poll your app in the 
> case where
> they are waiting for some asynchronous process to complete.

What does

> 
> Just my $.02

mean?

Filip
> 
> --
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.struts-atlanta.org
> 
> 
> ----- Original Message -----
> From: "Ionel Gardais" <io...@geomath.fr>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, June 25, 2003 7:56 AM
> Subject: delay before redirect
> 
> 
> > Hi,
> >
> > is it possible to set a delay before a redirect ?
> > I'd like to do that in order to display a result page for 5 seconds and
> > then go to the welcome page.
> >
> > I am already using an http-equiv="refresh" with a 300 seconds delay for
> > the whole page but I want to bypass it with a redirection after 
> 5 seconds.
> >
> >
> > thanks,
> > ionel
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: delay before redirect

Posted by James Mitchell <jm...@apache.org>.
I would suggest staying with the meta tag approach.  This lessens the burden
on the container and let's them (basically) poll your app in the case where
they are waiting for some asynchronous process to complete.

Just my $.02

--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org


----- Original Message -----
From: "Ionel Gardais" <io...@geomath.fr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, June 25, 2003 7:56 AM
Subject: delay before redirect


> Hi,
>
> is it possible to set a delay before a redirect ?
> I'd like to do that in order to display a result page for 5 seconds and
> then go to the welcome page.
>
> I am already using an http-equiv="refresh" with a 300 seconds delay for
> the whole page but I want to bypass it with a redirection after 5 seconds.
>
>
> thanks,
> ionel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org