I'm trying to redirect my user based on the value in the database but somehow my code doesnt seem to work. Even if the value of Status is "Pending" in the database it goes to
response.sendRedirect("deletestudentlist.jsp"); instead of
response.sendRedirect("viewstudentlist.jsp");
The problem i presume is in (status1 == "Pending") but not sure what is wrong. Please do help. Thank you.
rst1 = stm1.executeQuery("select Status from appraisal");
String status1 ="";
while(rst1.next()){
status1 = rst1.getString("Status") ;
}
if(status1 == "Pending"){
response.sendRedirect("viewstudentlist.jsp");
} else{
response.sendRedirect("deletestudentlist.jsp");
}