?
Solved

Servlet waiting page, processes, then redirecting to completed page

Posted on 2004-08-16
4
Medium Priority
?
1,536 Views
Last Modified: 2008-01-09
i have a form on a jsp (lets call it formjsp.jsp)... this form will call a servlet... the problem is that this servlet will take a long time to process... therefore, i want some indicator (something like a window, doesnt have to be a popup, it can just go to that new page called waiting.jsp) that tells the user to wait and not touch anything...

however, heres the tricky part, after the servlet is finished, i need it to redirect to the completed page (call it complete.jsp)... so if waiting.jsp was a popup, i'd like to close the popup... if waiting.jsp was a page on the original browser window, i want it to redirect to complete.jsp... does that make sense?

i have tried to do both page calls within the servlet, so i would have:
//SERVLET
public void doPost ... {
    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("waiting.jsp");
    dispatcher.include(request, response);

    //do long processing

    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("complete.jsp");
    dispatcher.forward(request, response);
    //btw, i have also tried >> response.sendRedirect("complete.jsp"); but neither of them work
}


another way ive thought of has been to forward directly to waiting.jsp and then make it forward a hidden submission to the servlet, which then redirects to complete.jsp when it is done... however, im not quite sure how to do this hidden submission (is there any other way besides using http-equiv?) and i also do not know how to forward the POST parameters.


if anyone has any elegant ways of accomplishing what i want, please suggest them

btw, i really do not wish to use javascript

thanks so much!
0
Comment
Question by:alskdj80
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 11

Accepted Solution

by:
sompol_kiatkamolchai earned 1000 total points
ID: 11810949
0
 
LVL 1

Expert Comment

by:burritoboy1227
ID: 11813571
why don't you want to use javascript?  i think it would impossible to do what you want without using some kind of client-side scripting.
0
 
LVL 4

Expert Comment

by:illusionz70
ID: 11817927
the way i would do it

1. call the servlet.use javascript to change the butto text corrosponding to ur function (for eg smthn like uploading or please wait)
2. let the servlet complete operation
3. redirect to the required page
u can also disable the submit button after submission so the user doesnt submit twice

cheers,
0
 
LVL 3

Author Comment

by:alskdj80
ID: 11820487
the reason i dont like javascript is because the browser support is tricky... just my personal preference, =)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introducing Priority Question, our latest feature.
The top devops trends for 2017 are focused on improved deployment frequency, decreased lead time for change and decreased MTTR.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month10 days, 22 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question