| Author |
How to exit from a jsp page
|
ramesh poorella
Ranch Hand
Joined: Jul 19, 2011
Posts: 42
|
|
Hi
i have one exit button . when i am click that button i want to exit from jsp page
|
 |
Ashwin Sridhar
Ranch Hand
Joined: Jul 09, 2011
Posts: 272
|
|
By exit do you mean to move out to another page or close down the application.
If its moving to some other page, try using <c:redirect> or <c:url>
|
Ashwin Sridhar
SCJP | SCWCD | OCA
|
 |
ramesh poorella
Ranch Hand
Joined: Jul 19, 2011
Posts: 42
|
|
Ashwin Sridhar wrote:By exit do you mean to move out to another page or close down the application.
No i want to close my browser window
|
 |
N Sahni
Ranch Hand
Joined: Jul 07, 2011
Posts: 55
|
|
You can do it in javascript by using window.close().
You might also want to check out this topic close browser window!
|
Thanks and Regards,
Nilesh Sahni | nsahni@infocepts.com | www.infocepts.com
|
 |
Ashwin Sridhar
Ranch Hand
Joined: Jul 09, 2011
Posts: 272
|
|
if you need to close the browser itself, you could use javascript.
But i am not sure how good a practce it is, to use javascript in a JSP file
|
 |
bhanu chowdary
Ranch Hand
Joined: Mar 09, 2010
Posts: 256
|
|
Ashwin Sridhar wrote:But i am not sure how good a practce it is, to use javascript in a JSP file
Using scriptlets inside a JSP is a bad practice, using Javascript is not. Usually client-side validations are done using javascript.
For the original poster, window.close() can be used.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56229
|
|
Just to forestall the inevitable next question, no, window.close() will not work. Browser security prevents closing a window that was not opened by window.open().
Besides, it's not your browser! You have no business trying to close it!
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: How to exit from a jsp page
|
|
|