79565105

Date: 2025-04-09 18:46:55
Score: 0.5
Natty:
Report link

My team eventually figured this out. Removing the GetMethodConvertingFilter did not have an effect, but we needed another filter instead. Adding a new bean to our Configuration class for HiddenHttpMethodFilter was the answer. This required some minor changes to our Edit.jsp pages as well. This allowed Spring to process PATCH requests. Below are the changes.

Configuration.java

@Bean
    public HiddenHttpMethodFilter hiddenHttpMethodFilter() {
        return new HiddenHttpMethodFilter();
    }

Edit.jsp Replace:

<form:form action="/home" method="PATCH" modelAttribute="modelAttribute">

With:

<form:form action="/home" method="POST" modelAttribute="modelAttribute">
 <input type="hidden" name="_method" value="PATCH" />
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: MustyProgrammer