"Please wait" message inside JSP
I Want to display Please wait message before executing JSP script tags..
Below is the code... but its not showing "Login Succesfull... Please wait ..." message it directly execute the script tags and display the the result...
Code:
<%@page import="mvc.helper.help" %>
<html>
<head>
<title>Login Succesfull</title>
</head>
<body>
Login succesfull...please wait
<%
String userName=(String)request.getAttribute("user");
help hp=new help();
String fName=hp.getName(userName);
String add=hp.getUser(userName);
String Email=hp.getUsers(userName);
%>
<%
request.setAttribute("fullName",fName);
request.setAttribute("Address",add);
request.setAttribute("Email",Email);
RequestDispatcher dispatcher=request.getRequestDispatcher("details.j sp");
dispatcher.forward( request, response);
%>
</body>
</html>
Re: "Please wait" message inside JSP
Moved from Advanced Java
db
Re: "Please wait" message inside JSP
Jsp is only a way to generate html.
Why do you want to display a "please wait" message if the action you're waiting on happens immediately?
Re: "Please wait" message inside JSP
No there is no reason behind it.... I just want to know that how to do this..?
Re: "Please wait" message inside JSP
I would guess you would do it using javascript, not with JSP. Of course the JSP could spit out the javascript, but that's a moot point.
Re: "Please wait" message inside JSP
It would have to be done on the client (ie Javascript as Kevin says), probably using AJAX.
The user logs in (an Ajax call) and the client then listens for the response.
When the server successfully logs in then the client sticks up the message and asks the server to handle the next step.
Something along those lines.
Re: "Please wait" message inside JSP
this can also achieved using Javascript setTimeout() method...
Be very careful in habdling this as this should execute only one time.., coz.. this script will run for every 5 seconds if u give setTimeout(5000)