Re: redirect a page

"Mr. Cristian Romanescu" <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
This is how it's done:

- Open the page below (sample.jsp..) from a popup JavaScript...

The idea is to open the popup and below you'll se: out.flush...

So basically I flush the HTML generated (a picture with an animation
image for example....) then flush it to client

then you do your work...

after your 10 inutes work :) is complete, you see that I do an redirect
again from JS....so the new generated page will be displayed....

I cut the OT issues from my JSP, but you'' figure it out.

========= SAMPLE.JSP================

<%@ page import="..."%>

<jsp:useBean id="formBean"
class="ro.finsiel.eunis.search.species.country.CountryBean"
scope="request">

<jsp:setProperty name="formBean"
property="*"/>

</jsp:useBean>

<%//INCLUDE HEADER HERE %>

<%@include file="../../header.jsp"%>

<%@include file="../header.jsp" %>

<SCRIPT language='JavaScript'>

<!--

function redirect() {

window.resizeTo(640,480);

window.moveTo(10, 10);

window.location.replace('../../temp/<%=filename%>');

}

//-->

</SCRIPT>

<%// INCLUDE FOOTER HERE %>

<%@include file="../footer.jsp" %>

<%out.flush();%>

<%// PDF GENERATION LOGIC %>

<%

System.out.println("Dumping data...");

pdfReport.writeData();

long msecs = Utilities.stopTimer();

System.out.println("done in " + msecs + "
ms.");

%>

<SCRIPT language='JavaScript'>

<!--

redirect();

//-->

</SCRIPT>

<% out.flush();%>

At 02:21 PM 3/6/2003 -0600, you wrote:

Hi,

I have a servlet which would take a while to generate the
output and

I was wondering if someone would let me know how to

show a "please wait" on browser until the final output is complete.

code snippet would be great.

-Alvin Chang

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.