I have the following bit of code in my java servlet:
if(passenger == null){
response.sendError(400, "The specified passenger does not exist.");
}
The page does redirect to the error page, however, the rest of the servlet code is still executed. How do I redirect and sort of ‘break’ out of the servlet?
1 Answer