@Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { String paramValue = request.getParameter(this.methodParam); if (StringUtils.hasLength(paramValue)) { String _method = request.getMethod(); String method = paramValue.toUpperCase(Locale.ENGLISH); if (("POST".equals(_method) && "PUT".equals(method)) || ("GET".equals(_method) && "DELETE".equals(method))) { HttpServletRequest wrapper = new HttpMethodRequestWrapper( request, method); filterChain.doFilter(wrapper, response); } } else { filterChain.doFilter(request, response); } }
@Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { String paramValue = request.getParameter(this.methodParam); if (StringUtils.hasLength(paramValue)) { String _method = request.getMethod(); String method = paramValue.toUpperCase(Locale.ENGLISH); if (("POST".equals(_method) && "PUT".equals(method)) || ("GET".equals(_method) && "DELETE".equals(method))) { HttpServletRequest wrapper = new HttpMethodRequestWrapper( request, method); filterChain.doFilter(wrapper, response); } } else { filterChain.doFilter(request, response); } }