aarschie
asked on
Display a message when JSP is waiting for a process to be completed
How to display a message on the browser when JSP is waiting for a process to be completed.
Help urgent .....
Thanks
Arschie
Help urgent .....
Thanks
Arschie
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use option 2 then. instead of redirect to page2.jsp, just use URL=second.servlet. e.g.
first.jsp submit to second.jsp
second.jsp:
<%
// get necessary parameters and save then in session.
%>
<html>
<head>
<META HTTP-EQUIV=Refresh CONTENT="0; URL=servleturl">
</head>
<body>
please wait!
</body>
</html>
servlet:
get parameter form session stored by second.jsp. process and redirect to final.jsp
first.jsp submit to second.jsp
second.jsp:
<%
// get necessary parameters and save then in session.
%>
<html>
<head>
<META HTTP-EQUIV=Refresh CONTENT="0; URL=servleturl">
</head>
<body>
please wait!
</body>
</html>
servlet:
get parameter form session stored by second.jsp. process and redirect to final.jsp
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you think session is burden use cookie
kennethxu,
i didn't see your code. My code is similar to yours. Sorry
i didn't see your code. My code is similar to yours. Sorry
Modified version of mine and kennethxu's idea
page1.jsp
<%
if(session.getAttribute("r efresh")!= null)
{
//check whethere process is completed
if(processcompleted)
{
session.removeAttribute("r efresh");
}
%>
<html>
<head>
<META HTTP-EQUIV=Refresh CONTENT="0; URL=page1.jsp">
</head>
<body>
please wait!
</body>
</html>
<%
}
else
{
%>
<html>
<!-- Your submission code to page2.jsp -->
</html>
<%
}
%>
page2.jsp
<%
//process for your submission code
session.setAttribute("refr esh","true ");
response.sendredirect("pag e1.jsp");
%>
page1.jsp
<%
if(session.getAttribute("r
{
//check whethere process is completed
if(processcompleted)
{
session.removeAttribute("r
}
%>
<html>
<head>
<META HTTP-EQUIV=Refresh CONTENT="0; URL=page1.jsp">
</head>
<body>
please wait!
</body>
</html>
<%
}
else
{
%>
<html>
<!-- Your submission code to page2.jsp -->
</html>
<%
}
%>
page2.jsp
<%
//process for your submission code
session.setAttribute("refr
response.sendredirect("pag
%>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't want any points here It really does not matter but I believe that the answer I posted is as valid as any of the other ones, to tell the truth is faster and easier to implement, but....
:c)
Javier
:c)
Javier
Yes your code should work, you are right. Sorry I should have actually included you in the split. I hope a moderator will also award some points to you.
As I said Girionis I'm not interested on the points, just on giving solutions, but .... :c)
Javier
Javier
ASKER