I have a simple code for an admin to log in on a JSP page, the code ran perfectly however now I keep getting this status 500 error and am unsure how to fix it.
<%
String adminusername = request.getParameter("adminusername");
String adminpass = request.getParameter("adminpass");
String adminconfpass = request.getParameter("adminconfpass");
//if statement to meet certain criteria before allowing access
if (adminusername.equals("clubadmin") && adminpass.equals("123") && adminconfpass.equals("123"))
{
//if criteria is met redirects admin to the admin home page
//https://stackoverflow.com/questions/4967482/redirect-pages-in-jsp utilized for this code
String redirectURL = "http://localhost:8080/SportClubLotteryFYP/adminhome.jsp";
response.sendRedirect(redirectURL);
}
else {
String redirectURL = "http://localhost:8080/SportClubLotteryFYP/adminlogin.jsp";
response.sendRedirect(redirectURL);
}
%>
It keeps telling me that I have an error at line 9 which is the start of the if statement but I see nothing wrong with the code. I am using Netbeans and Tomcat. Any help is greatly appreciated.