在春天MVC ... 我必須在記錄更新後重新加載頁面。因此,在操作方法,我返回字符串,作爲回報,我回到HTTP狀態405 - 在春季返回「重定向:*。*」時不支持請求方法'GET'mvc
return "redirect:/recordList";
當,但它給頁面
HTTP Status 405 - Request method 'GET' not supported
沒有例外的日誌即將來臨的例外。
我控制器的方法看起來像
@RequestMapping(value= "/recordList", method = RequestMethod.POST)
public ModelAndView getAssetListForUser(@RequestParam("ldapId") String ldapId,
final HttpServletRequest request){
而且,因爲我需要的值,如果ldapId在控制器的方法,我在調用方法這樣
request.setAttribute("ldapId", assetAssetEmp.getAssetEmpId());
請幫忙結合它。
改變它現在給HTTP狀態405 - 請求方法「POST」時,我直接從JSP的提交操作叫它不支持。 :( – romhail
然後如何讓GET和POST?'方法= {RequestMethod.POST,RequestMethod.GET}' –
一起刪除了RequestMethod.POST。現在它工作正常。 – romhail