After research on subjects concerning differences between spring boot and previous spring mvc frameworks. I am confused and need some help! How to do redirect to an html page since normally trying to redirect without the page target having a controller method returns HTTP 404.
if I have this controller method below that handles registration confirm:
@RequestMapping(value = "/registrationConfirm", method = RequestMethod.GET)
public String confirmRegistration(final HttpServletRequest request, Model
model, @RequestParam("token") final String token){
Locale locale = request.getLocale();
final String result = userService.validateConfirmationToken(token);
if (result.equals("valid")) {
final User user = userService.getUser(token);
authWithoutPassword(user);
model.addAttribute("message",
messages.getMessage("message.accountVerified", null, locale));
return "redirect:/home.html?lang=" + locale.getLanguage();
}
model.addAttribute("message", messages.getMessage("auth.message." +
result, null, locale));
model.addAttribute("expired", "expired".equals(result));
model.addAttribute("token", token);
return "redirect:/wrong.html?lang=" + locale.getLanguage();
}
I am getting http 404 error not found. Is it a must to have a Controller method specific for wrong.html page? if it is not required, how to run it that way.