winhowes
winhowes

Reputation: 8065

request.getParameter doesn't work for PUT or DELETE

If request is an HTTPServletRequest why can I use request.getParameter to get the body for a POST request, but not for a PUT or DELETE request?

Upvotes: 2

Views: 376

Answers (1)

Prasad
Prasad

Reputation: 1157

By default Put method is disabled as mostly we use Get and Post in regular jsps and servelts. But, it can be easily configure to support it. First, in order to allow Tomcat to accept commands other than HTTP GET and PUT we should add to Tomcat’s web.xml the following init param:

You can follow this below post for more explanation and set up.

http://www.codereye.com/2010/12/configure-tomcat-to-accept-http-put.html

Upvotes: 1

Related Questions