private void setDefaultResponsePageIfNecessary() {
if(!continueToOriginalDestination()) {
if(session.getRoles().equals("ROLE_ADMIN")){
setResponsePage(SearchForCapacity.class);
System.out.println("Role for Admin:" + session.getRoles());
} else if (session.getRoles().equals("ROLE_USER"));
setResponsePage(HomePage.class);
System.out.println("Role for User: " + session.getRoles());
}
}
Hi all, this extract is from my login class which works fine except it wont redirect to the correct page. I can print the roles to the console so for admin it will print ROLE_ADMIM etc. The problem is no matter what the role it always navigates to the same page (HomePage), does anyone know why this is? thanks.
The
else ifstatement is terminated by a;instead of opening a block with{.