我想要獲取用戶使用此請求處理程序後的最後一個字符串。有沒有可能做到這一點,而不是哈克?獲取URL路徑的最後部分
@Controller
@RequestMapping("/user/*")
public class Student{
@RequestMapping(method = RequestMethod.GET)
public String getUser(ModelMap model, /*, parameter that gets user id */) {
// function that gets user id
model.addAttribute("foo", "foo");
return "bar";
}
}
請解釋你試過的。 SO不是一種編碼服務。 – jasonszhao