dimanche 1 mars 2015

Jsp page not redirecting to another jsp page

I know this question has already been answered but i have a specific issue, when i return a redirect from a controller to another controller which returns a view, the view is sent as a response. I'm not able to display this JSP page sent in the response. The preview of the response is exactly what i want to display in the window. I'm able to do this with help of Ajax but i want my controller to redirect to the page.



@RequestMapping(value="validate")
public String validate(String validateLogin){
System.out.println("Validation begin");
System.out.println(validateLogin);
if(directoryService.validateUser(validateLogin)){
return "redirect:welcome";
}else{
return "/index";
}


redirects to



@RequestMapping(value="welcome")
public String justToRedirect(){
if(CurrentUser.getUserType().equalsIgnoreCase("admin")){
System.out.println("User type is Admin");
return "/welcomeAdmin";
}else if(CurrentUser.getUserType().equalsIgnoreCase("user")){
System.out.println("User type is Client");
return "/welcomeUser";
}else{
return "index";
}

Aucun commentaire:

Enregistrer un commentaire