I searched and searched and did not find anything that says it is impossible, and nothing that explains how to do it.
If you have an advanced base controller, I understand that query matching methods are also inherited.
So, with ....
public abstract class BaseController
{
@RequestMapping(value="hello", method=RequestMethod.GET)
public String hello(Model model) {
return "hello-view;
}
... a controller like this ...
@Controller
@RequestMapping("/admin/")
public abstract class AdminController
{
....
}
... inherits a method listening in / admin / hello that returns a hi-view.
Everything is fine.
But what if I have a BaseController method that redirects:
public abstract class BaseController
{
@RequestMapping(value="hello", method=RequestMethod.POST)
public String hello(Model model) {
return "redirect:/success/;
}
As I understand it, redirects require either a relative or an absolute URL, not a view name?
So how does my AdminController provide a redirect to / admin / success /?
How does the BaseController method get the descriptor at the class level @requestMapping on my AdminController?
Is it possible?