File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes how to call a javascript alert box from jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how to call a javascript alert box from jsp page" Watch "how to call a javascript alert box from jsp page" New topic

how to call a javascript alert box from jsp page

narender sunkam
Ranch Hand

Joined: May 01, 2004
Posts: 30
Hello jspians,
I had an application where user enters login name and password
if user name and password exists he is directed to main page.
I had database variables username,password,amount,duration.
here for example user had duration of 15 minutes,then he is not allowed
to stay as a valid user for more than 15 minutes on any of the jsp pages, before making his session invalidate I want to display a alert box before
3 minutes saying the user had 3 minutes of duration left for completeing
of his session logout, so that he knows the amount of time left.
what I am doing is when the user logins I am keeping the system time in
session,and I am getting duration from database also keeping in session.
I am accessing these session variables in other jsp pages.Using while loop
before 3 minutes I am calling javascript alert box.
But my problem is I am getting after jsp page is completeing loading.
But I want jsp page first after that internally the jsp page should perform the loop and at the certain time it should display the alert box.

Please any one could give me some good idea about this I am in urgent of this as I need to submit my application very soon.

narender kumar
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63529

You need to read this article for a better understanding of how JSPs work, and why what you are trying to do is not the right way to do it.
[ March 11, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: how to call a javascript alert box from jsp page
jQuery in Action, 3rd edition