【发布时间】:2023-03-09 17:46:01
【问题描述】:
我想配置 Spring 以将所有请求重定向到特定的控制器,而不考虑 URL(长度和参数)。我应该如何在 RequestMapping 注释中给出 URL 模式/正则表达式。我尝试使用下面的代码,但它不起作用。非常感谢这方面的任何帮助。
@Controller
@RequestMapping("/*")
public class ServiceController {
@RequestMapping( method = RequestMethod.GET, value = "*" )
public void getProjectList(HttpServletRequest httpServletRequest,Model model){
}
}
【问题讨论】:
标签: spring spring-mvc restful-url spring-restcontroller request-mapping