2 回答
TA貢獻(xiàn)1725條經(jīng)驗(yàn) 獲得超8個贊
對的,這是可能的
@RequestMapping (value = "/jsp/login", method = RequestMethod.GET)
public String showLoginWindow(@RequestParam(value = "error", required = false) String errorStr) throws LoginException {...}
重要的部分是required = false,所以如果你調(diào)用/jsp/loginerrorStr 的值為 null。
TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個贊
是 - 您可以有可選的請求參數(shù)。
@RequestMapping(value = "/jsp/login", method = RequestMethod.GET)
public @ResponseBody String handleLogin(
HttpServletRequest req,
@RequestParam(value="error",required = false) String error) {
//TODO: write your code here
return "success";
}
添加回答
舉報
