Announcement Announcement Module
No announcement yet.
Broke RESTfulness with Spring Security Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by dejanmr View Post
    Any progress on this?

    I have checked jira issue, and it seem to be fixed on 3.0.2.

    I have 3.0.3 version of spring and same/similar issue.

    I am new to spring MVC, so application is simple, and has simple security (guess it is relevant).

    So, although I put PUT as method, it ends up as POST, and I get error

    "Request method 'POST' not supported".
    Do a view source on your page and does your HTML form also have the hidden field in it. Also is your mapping method=RequestMethod.PUT?


    <form method="POST" action="YOURACTIONHERE">
    <all your tags for your form>
    <input type="hidden" name="_method" value="PUT"/>



    • #17
      Originally posted by bytor99999 View Post
      Do a view source on your page and does your
      <input type="hidden" name="_method" value="PUT"/>
      Exactly. Form is generated with spring form tag and method PUT, which is rendered to method POST and hidden field.

      I have pretty much made example similar to pet clinic sample code, which is working fine, by the way. Only difference is that I have spring security set up.


      • #18
        Any news on this? Did latter versions of the Spring or Spring security problem resolved the issue?

        Is there anyone made it working in expected way?


        • #19
          I managed to workaround this issue by changing the @RequestMapping annotation on the update method to:

          @RequestMapping(params = "_method=PUT")//method = RequestMethod.PUT)
          public java.lang.String update(@Valid Application application,

          This seems to work fine for me and calls the correct update method even with multipart inctype.
          Hope this helps someone