Reputation: 1082
I have some javascript that uses PUT requests and I'd like to be able to use request.getParameter() to read in variables. I know that Java EE does not parse stuff from PUT requests because HTML PUT was originally intended for file upload. However I am wondering if there is a way to force this behavior anyway or at a minimum how to access the parser Tomcat uses when it parses requests for POST and run it myself on the raw request string.
Thanks.
Upvotes: 5
Views: 1658
Reputation: 1082
The solution appears to be to add the following attribute to the Connector element of server.xml:
parseBodyMethods="POST, PUT"
This tells Tomcat to treat PUT requests like POST requests with respect to parsing the body.
Upvotes: 12