The moose likes Servlets and the fly likes Question: take too long to login??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Question: take too long to login???" Watch "Question: take too long to login???" New topic

Question: take too long to login???

lydia westland
Ranch Hand

Joined: Feb 24, 2002
Posts: 72
Dear Ranchers,
I had a problem when dealing with login. After clicking "login" button, the login takes up to 1 minutes, and during the servlet processing, the users just click this button again and again and again Can I change the mouse shape to something different during the transaction? Or can I have some temporary page saying "during login processing ..." things like that? what is a good method to resolve this?
I really appreciated your great help.

Lydia<br />~~~~~~~~~~~~<br />I love Italy team.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
I think the best solution would be some JavaScript to disable the button once it has been pressed. That way it doesn't take any action by the server side at all.
lydia westland
Ranch Hand

Joined: Feb 24, 2002
Posts: 72
Thank you very much Bill. I will try to use button1.disable.But my button is an image button. do you think it'll still work?
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
Do not make it a submit button.
when clicked, call a function where you check a variable before submitting. Change the value of a variable from 0 to 1. And only submit the form if this value is 0.
chanoch wiggers
Ranch Hand

Joined: May 24, 2001
Posts: 245
an increasingly common solution to this problem is to immediately redirect the user to a "please wait" page which has an automatic redirect using the META tag. Virgin trains in the uk has this, and they even cycle through a number of gifs that look like a clock counting down the seconds.
if you are worried about browsers that dont support refresh tags, etc, i dont think thats relevant anymore - browsers that dont support refresh tags are phone ones, some pda ones and robots, and represnt 0% of your typical traffic.
You can find information on the META tag to do this and/or how to do this with javascript on the internet if you search for javascript timer but here is a hint:

chanoch<p><a href="" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
I agree. Here's the link:
subject: Question: take too long to login???
It's not a secret anymore!