In PHP, when we want to stop the page processing, we can use the die() or exit() function. How to do the same thing in jsp?
EDIT I am using it to redirect to other page if the user is accessing a forbidden page (i.e those page that requires login or pages that is only accessible by specific IP addresses in the whitelist). In PHP, I am doing it like this:
<?php
...
if($logged_in && $ip_isValid){
// display page
}else{
// redirect to other page
}
...
or for easier reading/coding/development, I can use PHP's die()
like this:
<?php
...
if(!$logged_in || !$ip_isValid){
// redirect to other page or do some processing
die();
}
// else is not needed anymore here
// normal page execution
...
So if there is no equivalent for die()
or there is a better way of doing it, please tell me what can I do to achieve the same thing in JSP.