doPut
doPut is a method in the Java Servlet API used to handle HTTP PUT requests. It is declared in the HttpServlet class and is invoked by the servlet container when a client sends a PUT request to a URL mapped to the servlet. If not overridden, the default HttpServlet doPut implementation responds with 405 Method Not Allowed.
Semantics: HTTP PUT targets a specific resource URI and is generally idempotent. The request body carries a
Implementation: override the method with the standard signature protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
Relation to other methods: PUT targets a known URI and is distinct from POST, which is not
Example scenario: a RESTful file store may accept PUT /files/notes.txt with a payload containing file data; the