RE: Splash Screen in Struts
Nice, clear, and will be usefull for me. If you are using session beans it looks like you could use a generic splash since you wouldn't need the hidden fields. Thanks Edgar -Original Message- From: Dhruva B. Reddy [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 12:02 AM To: 'Struts Users Mailing List' Subject: Re: Splash Screen in Struts OK, for those of you following this thread, I ended up getting this to work, although it's kind of ugly IMHO. In splashAction, I cram the form containing the data from input.jsp into the request, then forward to splash.jsp, which keeps the data in hidden fields (populated by the previous form). The onload event handler in the body tag of splash.jsp automatically submits the form to longAction.do (the action that needed the data in the first place). There is a bit of lag time (0.5 to 1 second) in displaying the splash screen, but the browser (I've tried this with Mozilla and IE) then displays the splash screen until the results are ready. Thanks to those who responded to my original post. I wanted to try subclassing the ActionServlet as suggested, but I needed to get this and several other things done by the end of the week. Dhruva --- Dhruva B. Reddy [EMAIL PROTECTED] wrote: OK, let me ask this: Let's say that I have input.jsp, which goes to longAction.do, which in turn forwards to long_results.jsp when finished. I've noticed that the contents of input.jsp remain displayed after the submit button is clicked, until the contents of input.jsp are ready for the browser to load. I have tried to take advantage of this by creating an intermediate action, splashAction.do, which forwards to splash.jsp, which in turn forwards to longAction.do (I have a jsp:forward tag at the end of splash.jsp). splashAction.do is invoked by the submit button on input.jsp. I would expect the contents of splash.jsp to be displayed until the contents of long_results.jsp are ready for display. Yet the contents of input.jsp remain displayed until long_results.jsp is ready, just as before--I never see splash.jsp. Can anyone tell me why this didn't work? Thanks, Dhruva --- Dhruva B. Reddy [EMAIL PROTECTED] wrote: I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Thanks, Dhruva __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Splash Screen in Struts
I was following these mails and was trying to get a good solution for it. What I found was, its not necessary to have a spashAction class. Just a splash.jsp would do it. on onLoad call location.replace or window.open in self no time lag or anything dont have to keep anything is hidden fields and resubmit check out... Panchasheel -Original Message- From: Edgar Dollin [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 4:40 AM To: 'Struts Users Mailing List' Subject: RE: Splash Screen in Struts Nice, clear, and will be usefull for me. If you are using session beans it looks like you could use a generic splash since you wouldn't need the hidden fields. Thanks Edgar -Original Message- From: Dhruva B. Reddy [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 12:02 AM To: 'Struts Users Mailing List' Subject: Re: Splash Screen in Struts OK, for those of you following this thread, I ended up getting this to work, although it's kind of ugly IMHO. In splashAction, I cram the form containing the data from input.jsp into the request, then forward to splash.jsp, which keeps the data in hidden fields (populated by the previous form). The onload event handler in the body tag of splash.jsp automatically submits the form to longAction.do (the action that needed the data in the first place). There is a bit of lag time (0.5 to 1 second) in displaying the splash screen, but the browser (I've tried this with Mozilla and IE) then displays the splash screen until the results are ready. Thanks to those who responded to my original post. I wanted to try subclassing the ActionServlet as suggested, but I needed to get this and several other things done by the end of the week. Dhruva --- Dhruva B. Reddy [EMAIL PROTECTED] wrote: OK, let me ask this: Let's say that I have input.jsp, which goes to longAction.do, which in turn forwards to long_results.jsp when finished. I've noticed that the contents of input.jsp remain displayed after the submit button is clicked, until the contents of input.jsp are ready for the browser to load. I have tried to take advantage of this by creating an intermediate action, splashAction.do, which forwards to splash.jsp, which in turn forwards to longAction.do (I have a jsp:forward tag at the end of splash.jsp). splashAction.do is invoked by the submit button on input.jsp. I would expect the contents of splash.jsp to be displayed until the contents of long_results.jsp are ready for display. Yet the contents of input.jsp remain displayed until long_results.jsp is ready, just as before--I never see splash.jsp. Can anyone tell me why this didn't work? Thanks, Dhruva --- Dhruva B. Reddy [EMAIL PROTECTED] wrote: I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Thanks, Dhruva __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Splash Screen in Struts
OK, for those of you following this thread, I ended up getting this to work, although it's kind of ugly IMHO. In splashAction, I cram the form containing the data from input.jsp into the request, then forward to splash.jsp, which keeps the data in hidden fields (populated by the previous form). The onload event handler in the body tag of splash.jsp automatically submits the form to longAction.do (the action that needed the data in the first place). There is a bit of lag time (0.5 to 1 second) in displaying the splash screen, but the browser (I've tried this with Mozilla and IE) then displays the splash screen until the results are ready. Thanks to those who responded to my original post. I wanted to try subclassing the ActionServlet as suggested, but I needed to get this and several other things done by the end of the week. Dhruva --- Dhruva B. Reddy [EMAIL PROTECTED] wrote: OK, let me ask this: Let's say that I have input.jsp, which goes to longAction.do, which in turn forwards to long_results.jsp when finished. I've noticed that the contents of input.jsp remain displayed after the submit button is clicked, until the contents of input.jsp are ready for the browser to load. I have tried to take advantage of this by creating an intermediate action, splashAction.do, which forwards to splash.jsp, which in turn forwards to longAction.do (I have a jsp:forward tag at the end of splash.jsp). splashAction.do is invoked by the submit button on input.jsp. I would expect the contents of splash.jsp to be displayed until the contents of long_results.jsp are ready for display. Yet the contents of input.jsp remain displayed until long_results.jsp is ready, just as before--I never see splash.jsp. Can anyone tell me why this didn't work? Thanks, Dhruva --- Dhruva B. Reddy [EMAIL PROTECTED] wrote: I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Thanks, Dhruva __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Splash Screen in Struts
I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Thanks, Dhruva __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Splash Screen in Struts
I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Found this article: JSP Progress Bars http://www.onjava.com/pub/a/onjava/2003/06/11/jsp_progressbars.html This might be interesting, too (but maybe too much for your needs): http://www.javaworld.com/javaworld/jw-03-2000/jw-03-pushlet.html? There's also some tricks with JavaScript and/or HTML-META-REFRESH tags, search the user-list.. HTH, Yann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Splash Screen in Struts (Please Wait page)
Yes. But beware O Man, beware, of Those who tread in Darkness the ramparts of Kadath, for he that beholds Their mitred-heads shall know the claws of doom. I've actually been struggling with this for a while now, and have come up with a solution that (mostly) works, but it has been difficult. Our requirements were: 1) Display a happy little animation for the user's benefit 2) Have browser's throbber throb while the wait page is displayed 3) Work within the Struts framework 4) Being a good netizen, you want this to work on different browsers The best solution I have found is to extend ActionServlet and ActionMapping in order to add a please wait flag to both via struts-config. Your WaitActionMapping would simply have private boolean showWaitPage = false; with the appropriate getter and setters in it. You would then set this parameter via struts-config and be done with that part of it. In WaitActionServlet you would check the showWaitPage value for that mapping, and if true you would at this point show the splash screen using (!) out.prints. After this you would do an out.flush(), which would show the splash screen to the user but leave the connection open. Now you do your heavy-duty task, probably in a separate thread, and check it occasionally from within WaitActionServlet. If it's done, you send some JavaScript to overwrite the splash screen and forward to the appropriate JSP as defined in your struts-config. Now, this is all completely theoretical, because our rather expensive servlet container has an extremely irritating bug that causes out.flush() to not work. The solution we implemented involves -Original Message- From: Dhruva B. Reddy [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2003 2:23 PM To: Struts Users Mailing List Subject: Splash Screen in Struts I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Thanks, Dhruva __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Splash Screen in Struts
OK, let me ask this: Let's say that I have input.jsp, which goes to longAction.do, which in turn forwards to long_results.jsp when finished. I've noticed that the contents of input.jsp remain displayed after the submit button is clicked, until the contents of input.jsp are ready for the browser to load. I have tried to take advantage of this by creating an intermediate action, splashAction.do, which forwards to splash.jsp, which in turn forwards to longAction.do (I have a jsp:forward tag at the end of splash.jsp). splashAction.do is invoked by the submit button on input.jsp. I would expect the contents of splash.jsp to be displayed until the contents of long_results.jsp are ready for display. Yet the contents of input.jsp remain displayed until long_results.jsp is ready, just as before--I never see splash.jsp. Can anyone tell me why this didn't work? Thanks, Dhruva --- Dhruva B. Reddy [EMAIL PROTECTED] wrote: I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Thanks, Dhruva __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Splash Screen in Struts (Please Wait page) (Cont'd, sorry)
-Original Message- From: James Childers Sent: Tuesday, July 15, 2003 2:59 PM To: Struts Users Mailing List Subject: RE: Splash Screen in Struts (Please Wait page) Yes. But beware O Man, beware, of Those who tread in Darkness the ramparts of Kadath, for he that beholds Their mitred-heads shall know the claws of doom. I've actually been struggling with this for a while now, and have come up with a solution that (mostly) works, but it has been difficult. Our requirements were: 1) Display a happy little animation for the user's benefit 2) Have browser's throbber throb while the wait page is displayed 3) Work within the Struts framework 4) Being a good netizen, you want this to work on different browsers The best solution I have found is to extend ActionServlet and ActionMapping in order to add a please wait flag to both via struts-config. Your WaitActionMapping would simply have private boolean showWaitPage = false; with the appropriate getter and setters in it. You would then set this parameter via struts-config and be done with that part of it. In WaitActionServlet you would check the showWaitPage value for that mapping, and if true you would at this point show the splash screen using (!) out.prints. After this you would do an out.flush(), which would show the splash screen to the user but leave the connection open. Now you do your heavy-duty task, probably in a separate thread, and check it occasionally from within WaitActionServlet. If it's done, you send some JavaScript to overwrite the splash screen and forward to the appropriate JSP as defined in your struts-config. Now, this is all completely theoretical, because our rather expensive servlet container has an extremely irritating bug that causes out.flush() to not work. The solution we implemented involves subclassing Action and adding a parameter to the session that indicates if the task is done or not. The JSP has a meta-refresh tag in the head section that submits to the Action every couple of seconds; the Action checks to see if the task is done. If so, it forwards to the success JSP. If not, it forwards to the wait page again. -= J - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Splash Screen in Struts
Dhruva, I have done this before the absolute cleanest implementation is almost 100% javascript: 1) Javascript submit(); call to start POST page loading 2) Javascript delete contents of the window (javascript:document.clear();) 3) Write new content to the window... adding in an img tag to a animated GIF (or, cooler a Flash movie) this is done with one call to document.write(str); You have to populate the str variable first because each document.write causes the window to be cleared and then rewritten. Item #2 is somewhat optional, but I like it for clarity and I'm a little weird. Aaron Dhruva B. Reddy wrote: I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Thanks, Dhruva __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Splash Screen in Struts
Aaron, what will happen when server action takes 1-5 min? user may get TIMEOUT ... tnx -Original Message- From: Aaron Longwell [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2003 1:27 PM To: Struts Users Mailing List Subject: Re: Splash Screen in Struts Dhruva, I have done this before the absolute cleanest implementation is almost 100% javascript: 1) Javascript submit(); call to start POST page loading 2) Javascript delete contents of the window (javascript:document.clear();) 3) Write new content to the window... adding in an img tag to a animated GIF (or, cooler a Flash movie) this is done with one call to document.write(str); You have to populate the str variable first because each document.write causes the window to be cleared and then rewritten. Item #2 is somewhat optional, but I like it for clarity and I'm a little weird. Aaron Dhruva B. Reddy wrote: I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Thanks, Dhruva __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Splash Screen in Struts
This doesn't seem to work--nothing after the first submit() call gets executed. I assume you put all of this code in the onclick handler for the submit button. --- Aaron Longwell [EMAIL PROTECTED] wrote: Dhruva, I have done this before the absolute cleanest implementation is almost 100% javascript: 1) Javascript submit(); call to start POST page loading 2) Javascript delete contents of the window (javascript:document.clear();) 3) Write new content to the window... adding in an img tag to a animated GIF (or, cooler a Flash movie) this is done with one call to document.write(str); You have to populate the str variable first because each document.write causes the window to be cleared and then rewritten. Item #2 is somewhat optional, but I like it for clarity and I'm a little weird. Aaron Dhruva B. Reddy wrote: I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Thanks, Dhruva __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Splash Screen in Struts
I'll have to look into this... I know I did it before in a situation with frames Javascript was actually executed in some other frame... so that the long-loading window could be manipulated by another frame (which can always execute javascript even when the other window is loading). Dhruva B. Reddy wrote: This doesn't seem to work--nothing after the first submit() call gets executed. I assume you put all of this code in the onclick handler for the submit button. --- Aaron Longwell [EMAIL PROTECTED] wrote: Dhruva, I have done this before the absolute cleanest implementation is almost 100% javascript: 1) Javascript submit(); call to start POST page loading 2) Javascript delete contents of the window (javascript:document.clear();) 3) Write new content to the window... adding in an img tag to a animated GIF (or, cooler a Flash movie) this is done with one call to document.write(str); You have to populate the str variable first because each document.write causes the window to be cleared and then rewritten. Item #2 is somewhat optional, but I like it for clarity and I'm a little weird. Aaron Dhruva B. Reddy wrote: I have an Action that could potentially take a long time to execute, and would like to display a splash screen until the results of the action are ready. I went googling for this, but I can't seem to find a solution that would fit within the Struts framework. Has anyone done this before? Thanks, Dhruva __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]