I am trying to catch all unconfigured routes once all other controllers have been checked and no route matches.
My controller is as below:
@Controller
public class ForwardController {
@RequestMapping(value = "/**/{[path:[^\\.]*}")
public String redirect() {
return "forward:/";
}
}
But this does not match : http://localhost:8080/abc/def
May I request some guidance on this?
My goal is to not have to handle /error and catch unconfigured routes which otherwise would lead to /error
I fixed this using:
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/**/{path:[^\\.]+}").setViewName("forward:/");
}
The only issue now is that images are not rendering.