I am trying to implement put method in JSP form, but seems like it is supported, what is the reason behind it ? Where if i am using HTML instead of JSP and calling a servlet implemented to accept put request, then it is working as expected. but same code is not working on JSP.
Example of HTML Which is working "index.html">>>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>PUT Method Test</title>
</head>
<body>
<form enctype="multipart/form-data" **method="PUT"**
action="RequestTester">
<input type="file" size="20" name="FileToUpload"
value="Select File">
<input type="submit" name="UploadFile" value="Upload">
<input type="reset" value="Reset">
</form>
</body>
</html>
Example of HTML Which is not working "index.jsp">>>
<form enctype="multipart/form-data" **method="PUT"**
action="RequestTester">
<input type="file" size="20" name="FileToUpload"
value="Select File">
<input type="submit" name="UploadFile" value="Upload">
<input type="reset" value="Reset">
</form>
MyServlet class>>
public class RequestTester extends HttpServlet {
private static final long serialVersionUID = 1L;
public PostRequestTester() {
super();
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
System.out.println("GET REQUEST STARTED..");
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
System.out.println("POST REQUEST STARTED..");
}
protected void doPut(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
System.out.println("PUT REQUEST STARTED..");
}
}