我想配置Spring將所有請求重定向到特定的控制器,而不考慮URL(長度和參數)。我應該如何在RequestMapping註釋中提供URL模式/正則表達式。我嘗試使用下面的代碼,但它不工作。任何在這方面的幫助深表感謝。Spring REST請求映射
@Controller
@RequestMapping("/*")
public class ServiceController {
@RequestMapping(method = RequestMethod.GET, value = "*")
public void getProjectList(HttpServletRequest httpServletRequest,Model model){
}
}
我們以前使用過上面的控制器映射,沒有方法參數,維護服務器顯示服務器當前正在維護中。有用... –