Hmm, haven't tried this yet, but think using xmlhttprequest would be easier,
action 1 will call jsp 1 which has xmlhttprequest, javascript will then
forward the request to servlet while showing something flashy,
once everything comes back, replace the current html page with the text,
which is basically the page after processing.
I guess that should do it.
Amin
- Original Message -
From: "Daniel Perry" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" ; "Shiva Narayana"
<[EMAIL PROTECTED]>
Sent: Thursday, April 07, 2005 6:15 PM
Subject: RE: Please wait page
A couple of ways to do this:
Method1 - Page1 submits to Action1 - on submitting hide main div enclosing
page, and show a div with "processing..." until Action1 responds with
Page2
Method2 - Page1 submits to Action1. Action1 shows Page2 (Processing...),
and
immediatly submits to Action2 which shows Page3 when it completes. Page2
shoudl appear for the duration of processing thanks to response buffering.
Method3 (long transactional tasks)- Page1 submits to Action1. Action1
starts the transaction, and leaves it to run in the background. Action1
redirects to Action2 which checks if transaction complete, if so forwards
to
Action3 otherwise shows Page2 (processing) which refreshes every few
seconds
Action2. When it eventually forwards to Action3, Action3 gets the results
from the transaction and shows them.
Daniel.
-Original Message-
From: Shiva Narayana [mailto:[EMAIL PROTECTED]
Sent: 07 April 2005 11:09
To: Struts Users Mailing List
Subject: Re: Please wait page
Asuthosh,
This one is different from my requirement...i want to display the
message when the action class loading ...but in this case it it is
displaying the message when the page is loading...
regards
Shiva
On Apr 7, 2005 3:17 PM, Ashutosh Satyam <[EMAIL PROTECTED]> wrote:
> Hi Shiva,
> I'm enclosing a sample JSP page which you can use
> for giving the appearance that it's waiting till
> the DB processing goes through.
>
> - - - - - - - - - - - - wait.jsp - - - - - - - - - - - - - - - - -
>
|
>
|
>
|
> #waitpart { position: absolute; }
|
> #mainpart { position: absolute; visibility: hidden; } |
>
|
>
|
>
|
> function init () {
|
>if (document.layers) {
|
>document.waitpart.visibility = 'hide';
> |
>document.mainpart.visibility = 'show';
> |
>} else if(document.all) {
|
>document.all.waitpart.style.visibility = 'hidden';
> |
>document.all.mainpart.style.visibility = 'visible';
> |
>} else if (document.getElementById) {
|
>var elm = document.getElementById('waitpart');
> |
>elm.style.visibility ='hidden';
> |
>elm = document.getElementById('mainpart');
> |
>elm.style.visibility ='visible';
|
>}
|
> }
|
>
|
>
|
>
|
>
|
>
|
> Wait please ...
> |
>
|
> <%
|
> //make sure the contents so far has been flushed
> |
> out.flush();
|
> %>
|
>
|
> <%
|
> //just for testing.
|
> // Your DB Processing relevant code comes here
> |
> for (int i=0; i <10; i++) {
|
>out.println("Record:"+i);
|
>out.println("");
|
> }
|
> %>
|
> Here comes the page
> |
>
|
>
|
>
|
> - - - - - - - - - - - - - end page - - - - - - - - - - - - - - - -
>
> Hope this gives you enough insight and you may think of better
> alternative and share with others.
>
> Regards,
> Ashutosh
>
> -Original Message-
> From: Shiva Narayana [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 07, 2005 2:43 PM
> To: user@struts.apache.org
> Subject: Please wait page
>
> hi all,
>
> I m developing an application using WSAD 5.1.1,Struts.
> I m trying to fetch data from the database. I m writing the code in
> action class...
> i want to display a page while doing the processing
>
> please help me.
>
> the same logic is implemented in the site www.travelocity.com
>
> --
> Regards
> Shiva
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> -
> To unsubscribe, e-mail: