You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by andy wix <st...@hotmail.com> on 2004/10/13 17:29:31 UTC

The old 'please wait' issue

Hi,

I am trying to implement a 'please wait' page and have seen the stuff in the 
archives.
The method of choice seems to be:

* The Action that is currently doing the work should instead fire  off a 
background thread to do it.  It  then forwards to a "Please Wait" page.

* The background thread does its work then sets a flag in the user's session 
when it's done.

* The "Please Wait" uses a meta-refresh tag to automatically submit itself  
every few seconds, with the destination being a "Done Yet" action.

* The "Done Yet" action will consult the flag variable in the user's 
session.
If its not there, forward back to the "Please Wait" page again.  If it's  
done, forward to the view from the original action.

The problem is that I am using Tiles and so cannot have (as far as I know) a 
meta-refresh tag as this should go in the head of the document.  Likewise I 
can't use on-load javascipt as I don't have a body tag.

Thanks,
Andy

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger


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


Re: The old 'please wait' issue

Posted by Eddie Bush <ea...@swbell.net>.
You've got a template somewhere that dictates the layout for your pages, 
right?  So, what's to keep you from having a template -- exactly like that 
one -- with a meta refresh tag in the head?  Hrm ... that might be too easy 
though.  You might even see some reuse out of it if you have other time you 
wish to do this same thing.

Regards,

Eddie

----- Original Message ----- 
From: "andy wix" <st...@hotmail.com>
To: <us...@struts.apache.org>
Sent: Wednesday, October 13, 2004 10:29 AM
Subject: The old 'please wait' issue


> Hi,
>
> I am trying to implement a 'please wait' page and have seen the stuff in 
> the archives.
> The method of choice seems to be:
>
> * The Action that is currently doing the work should instead fire  off a 
> background thread to do it.  It  then forwards to a "Please Wait" page.
>
> * The background thread does its work then sets a flag in the user's 
> session when it's done.
>
> * The "Please Wait" uses a meta-refresh tag to automatically submit itself 
> every few seconds, with the destination being a "Done Yet" action.
>
> * The "Done Yet" action will consult the flag variable in the user's 
> session.
> If its not there, forward back to the "Please Wait" page again.  If it's 
> done, forward to the view from the original action.
>
> The problem is that I am using Tiles and so cannot have (as far as I know) 
> a meta-refresh tag as this should go in the head of the document. 
> Likewise I can't use on-load javascipt as I don't have a body tag.
>
> Thanks,
> Andy 



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0442-3, 10/15/2004
Tested on: 10/15/2004 8:17:09 PM
avast! - copyright (c) 2000-2004 ALWIL Software.
http://www.avast.com




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


Re: The old 'please wait' issue

Posted by Jeff Beal <jb...@webmedx.com>.
I had something worked up on a former project that allowed me to add 
extra header information on a page-by-page basis to Tiles.  I don't have 
access to the source code any more, but it looked something like this:

Tiles definition file:

<tiles-definition>
  <definition name="master" page="masterLayout.jsp">
   <tiles:put name="extra.head.content" value=""/>
   <tiles:put name="header" value="header.jsp"/>
   <tiles:put name="body" value="blank.jsp"/>
   <tiles:put name="footer" value="footer.jsp"/>
  </definition>
  <definition name="page1" extends="master">
   <tiles:put name="extra.head.content" value="&lt;meta refresh='111'&gt;">
   <tiles:put name="body" value="page1.jsp"/>
  </definition>
</tiles-definition>

I don't think that I used the extra.head.content parameter in exactly 
this way and I haven't used Tiles in a while, but you may be able to get 
something put together this way.

-- Jeff

andy wix wrote:
> The problem is that I am using Tiles and so cannot have (as far as I 
> know) a meta-refresh tag as this should go in the head of the document.  
> Likewise I can't use on-load javascipt as I don't have a body tag.
> 
> Thanks,
> Andy
> 


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


Re: Disappearing request values

Posted by Lee Harrington <le...@gmail.com>.
That did the trick.  I hadded "redirect=false" to the forward and now
all of my request variables are still in the request scope.  Thank you
VERY much.

Lee


On Wed, 13 Oct 2004 12:12:58 -0400, David G. Friedman
<hu...@ix.netcom.com> wrote:
> Lee,
> 
> Is your actionMapping using 'redirect="true"'?  Try adding (or changing, if
> you already have it) your forward's redirect parameter to "false".  This
> will make the forward internal so the browser does nothing, struts passes
> everything internally and loses nothing.  Additionally, if you are
> displaying a page for the user who must click to continue, try using
> html:hidden tags so that new page's form will be able to pass your
> variables, as you desire, without using a session scoped bean.
> 
> Regards,
> David
> 
> 
> 
> -----Original Message-----
> From: Lee Harrington [mailto:leebase@gmail.com]
> Sent: Wednesday, October 13, 2004 12:06 PM
> To: Struts Users Mailing List
> Subject: Disappearing request values
> 
> I have an action that forwards to a second action.  I set values in
> the request scope in the first action, but in the second action the
> values are null.
> 
> I solved my immediate need by putting the value in a session.  As the
> value is not needed for more than passing into the second action, I'd
> prefer not to use session variables.
> 
> Any help would be appreciated.
> 
> Lee
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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


RE: Disappearing request values

Posted by "Freddy Villalba A." <fv...@pericless.com>.
Are you redirecting or just forwarding to the second action?

-----Mensaje original-----
De: Lee Harrington [mailto:leebase@gmail.com]
Enviado el: miercoles, 13 de octubre de 2004 18:06
Para: Struts Users Mailing List
Asunto: Disappearing request values


I have an action that forwards to a second action.  I set values in
the request scope in the first action, but in the second action the
values are null.

I solved my immediate need by putting the value in a session.  As the
value is not needed for more than passing into the second action, I'd
prefer not to use session variables.

Any help would be appreciated.

Lee

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


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


RE: Disappearing request values

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Lee,

Is your actionMapping using 'redirect="true"'?  Try adding (or changing, if
you already have it) your forward's redirect parameter to "false".  This
will make the forward internal so the browser does nothing, struts passes
everything internally and loses nothing.  Additionally, if you are
displaying a page for the user who must click to continue, try using
html:hidden tags so that new page's form will be able to pass your
variables, as you desire, without using a session scoped bean.

Regards,
David

-----Original Message-----
From: Lee Harrington [mailto:leebase@gmail.com]
Sent: Wednesday, October 13, 2004 12:06 PM
To: Struts Users Mailing List
Subject: Disappearing request values


I have an action that forwards to a second action.  I set values in
the request scope in the first action, but in the second action the
values are null.

I solved my immediate need by putting the value in a session.  As the
value is not needed for more than passing into the second action, I'd
prefer not to use session variables.

Any help would be appreciated.

Lee

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


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


Disappearing request values

Posted by Lee Harrington <le...@gmail.com>.
I have an action that forwards to a second action.  I set values in
the request scope in the first action, but in the second action the
values are null.

I solved my immediate need by putting the value in a session.  As the
value is not needed for more than passing into the second action, I'd
prefer not to use session variables.

Any help would be appreciated.

Lee

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


Re: The old 'please wait' issue

Posted by Andrew Close <ac...@gmail.com>.
you can easily implement this using CSS (and a little javascript) and
have it work with Tiles.

in your style sheet add this: (and style it any way you want)
div#Processing {
	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
	position: absolute;
	text-align: center;
	top: 150px;
	visibility: hidden;
	width: 625px;
}

at the bottom of your page add this:

	<!-- Processing Please Wait -->	
		<div id="Processing">
			<h3>Processing, Please Wait...</h3>
		</div>

and add this to your javascript file:

function processingPleaseWait() {
	if (document.all.Header) {
		document.all.Header.style.visibility = "hidden";
	}
	if (document.all.Main) {
		document.all.Main.style.visibility = "hidden";
	}
	if (document.all.Footer) {
	 	document.all.Footer.style.visibility = "hidden";
	}
	if (document.all.Processing) { 
		document.all.Processing.style.visibility = "visible";		
	}
}

in your Tiles template file make sure you wrap each 'tile'  with a
<div id="appropriateId"> and then modify the javascript above to take
into account each of those divs as necessary.

so on my page i have a header a main content block and a footer.  when
i submit the page (whatever action) i call the processingPleaseWait()
which hides the appropriate sections and makes the processing message
pop up visible in the middle of the screen.

i'm not sure if there's a more 'Struts' appropriate way to do this
without dealing with threads...

andy

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


Re: The old 'please wait' issue

Posted by Hubert Rabago <hr...@gmail.com>.
It's common to see "please wait" messages that look different from the
rest of the app.  You may be able to get away with using a totally
different page/layout for this page.  If not, you can consider using
javascript to do the automatic submission.


On Wed, 13 Oct 2004 15:29:31 +0000, andy wix <st...@hotmail.com> wrote:
> Hi,
> 
> I am trying to implement a 'please wait' page and have seen the stuff in the
> archives.
> The method of choice seems to be:
> 
> * The Action that is currently doing the work should instead fire  off a
> background thread to do it.  It  then forwards to a "Please Wait" page.
> 
> * The background thread does its work then sets a flag in the user's session
> when it's done.
> 
> * The "Please Wait" uses a meta-refresh tag to automatically submit itself
> every few seconds, with the destination being a "Done Yet" action.
> 
> * The "Done Yet" action will consult the flag variable in the user's
> session.
> If its not there, forward back to the "Please Wait" page again.  If it's
> done, forward to the view from the original action.
> 
> The problem is that I am using Tiles and so cannot have (as far as I know) a
> meta-refresh tag as this should go in the head of the document.  Likewise I
> can't use on-load javascipt as I don't have a body tag.
> 
> Thanks,
> Andy
> 
> _________________________________________________________________
> It's fast, it's easy and it's free. Get MSN Messenger today!
> http://www.msn.co.uk/messenger
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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


Re: The old 'please wait' issue

Posted by Lionel <co...@free.fr>.
andy wix wrote:

> The problem is that I am using Tiles and so cannot have (as far as I
> know) a meta-refresh tag as this should go in the head of the
> document.  Likewise I can't use on-load javascipt as I don't have a
> body tag.

response.setHeader("Refresh", "...");




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