How should I call the Servlet doPut() method using JSP form with HTTP method PUT

I googled up and got the the following result:
Using PUT method in HTML form

Now I did this by following way:

protected void service(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        String method = req.getMethod();
        if (method.equals("GET")) {
            this.doDelete(req, resp);

Is there any other way to call the doPut() method without overriding in the service() method?

I have a list of products. Now I want to update the product details using the servlet doPut() method by using JSP form with the HTTP method, PUT.

This is my JSP form:

<form class="form-horizontal" action="${pageContext.request.contextPath}/book/update" method="post">

Source: jsp

Leave a Reply