HTTP method POST is not supported by this URL

Code of servlet:

package com.example.web;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class BeerSelect extends HttpServlet{
    public void doPost(HttpServletResponse response,
            HttpServletRequest request)
            throws IOException, ServletException{
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("Beer Selection Advice<br>");
        String c = request.getParameter("color");
        out.println("<br>Got beer color " + c);
    }
}

xml:

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

<servlet>
    <servlet-name>Ch3 Beer</servlet-name>
    <servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>Ch3 Beer</servlet-name>
    <url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>
</web-app>

html

<html><body>
<h1 align = "center">Beer Selection Page</h1>
<form method = "POST" action = "SelectBeer.do">
    Select beer characteristics

Color: <select name = "color" size = "1"> <option value = "light">light</option> <option value = "amber">amber</option> <option value = "brown">brown</option> <option value = "dark">dark</option> </select> <br><br> <center> <input type = "SUBMIT"> </center> </form></body></html>

Mar.21,2021

https://stackoverflow.com/que.
see if this solution helps

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3c8f2-446db.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3c8f2-446db.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?