Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3497146
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:20:06+00:00 2026-05-18T12:20:06+00:00

Spring 3 MVC supports all 4 of RESTful methods: GET, POST, PUT and DELETE.

  • 0

Spring 3 MVC supports all 4 of RESTful methods: GET, POST, PUT and DELETE. But does its view technology support them on forms? If not, what is the real use of method attribute in form:form tag?

I tried to use PUT method on the form:

<form:form action="/myaction" method="PUT">
   ...
</form:form>

Generated HTML was:

<form id="command" action="/myaction" method="post">
   <input type="hidden" name="_method" value="PUT"/>
   ...
</form>

It is clear since most browsers don’t support other methods besides GET and POST. But Spring can handle it with additional input with name _method and value METHOD_NAME. Does it?

When I send specified form to a controller method annotated with

@RequestMapping(method=RequestMethod.PUT)

it claims, that request method POST is not supported. But why POST and not PUT? What actually happens under the hoods?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T12:20:07+00:00Added an answer on May 18, 2026 at 12:20 pm

    The use of the “hidden parameter” called _method is not specific to Spring MVC’s tag library, but is also used by a few other client frameworks. Spring is just following the convention, such as it is.

    In order to use this properly, you need to add a filter to your web.xml, (HiddenHttpMethodFilter, see javadoc), which turns the _method parameter into a “real” HTTP method representation in the HttpServletRequest. This is done as a filter to emphasise the fact the the lack of PUT and DELETE is a browser problem – the servlet API supports it just fine.

    So if you want to use these methods in your form, you need to add that filter.

    P.S. The reason you get the “POST not supported” message is that your form uses POST, and your handler is annotated with PUT, so it doesn’t match. Because you don’t have the filter defined, the _method parameter is ignored.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a Spring MVC project, and I have unit tests for all
I have a Spring-MVC 3.0 web application built with Maven. All Spring dependency versions
In Spring MVC 3 on Tomcat 6, I can't seem to get RequestMappings of
I am using Spring MVC to build my web application, and I have a
We are using Hibernate 3.1 with Spring MVC 2.0. Our problem occurs when data
My company has been evaluating Spring MVC to determine if we should use it
I'm currently building a Spring MVC application. I was looking to use JSP pages
I'm building a MVC web application (using the Spring MVC framework), and I'm a
What is a very good jsp framework to use with Spring MVC. Are the
I basically have the following flow: XML -> JSON -> Spring MVC -> jsp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.