Announcement Announcement Module
No announcement yet.
Upgrade from Spring MVC 3.0.5 to 3.1.0 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upgrade from Spring MVC 3.0.5 to 3.1.0


    I've been upgrading my application from Spring 3.0.5-RELEASE to Spring 3.1.0-RELEASE this morning.
    I upgrade all dependencies excepts Spring Security.

    I now encounter a problem.

    I have some REST url that i use with different request mapping :
    .../flows/settings/{flowId} ==> GET
    .../flows/settings/{flowId} ==> POST
    .../flows/settings/{flowId} ==> DELETE

    The GET goes well but when i try POST or DELETE, i got this error :
    Request method 'POST' not supported

    I've spend the whole afternoon searching the web and i don't understand what i'm missing ..

    Does someone have an idea ?
    thx a lot


  • #2
    It would help if you showed what your request mappings look like.


    • #3
      In fact, i've found my problem.
      I've some CRUD JSPs like this :
      <form:form commandName="endpoint" id="form">
      Where the url was something like ..../endpoint/{id}

      In my controller, i've :

      @RequestMapping(value="/{id}", method=RequestMethod.GET)
      public String view(Model model, @PathVariable Integer id) {
      model.addAttribute("endpoint", adminService.getEndpointById(id));
      return "endpoints/view";

      public String save(Model model, @ModelAttribute("endpoint") @Valid Endpoint endpoint) {

      public String delete(Integer id, Model model) {

      I've simply add the action attribute to the form tag and it works :
      <c:url value="/settings/endpoints" var="formUrl"/>
      <form:form commandName="endpoint" id="form" action="${formUrl}">

      I now appear to me that it is normal to add this.
      But, at final, i don't understand how my code has been working in the past.