springmvc开发,方法设置method = RequestMethod.POST,浏览器地址栏请求,抛出HTTP Status 405 - Request method 'GET' not supported。如何拦截请求方法异常,HandlerInterceptor无法拦截到?
3条回答 默认 最新
hanhui_guo 2015-08-24 06:42关注if(Context.Request.HttpMethod.ToLower()!="post"){
return "不是post请求"
}else{
正常访问其他代码
}解决 无用评论 打赏 举报