I am new to JSP.

In the code below (index.jsp) , οn the first click, the page shows null.
After the second click, the page shows the right value.

Java Code:
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <form name="demo" action="index.jsp" method="POST">
            <input type="text" name="btn" value="button1" style="display:none"/>
            <input type="submit" value="Button 1">
        </form>
        <form name="demo" action="index.jsp" method="POST">
            <input type="text" name="btn" value="button2" style="display:none"/>
            <input type="submit" value="Button 2">
        </form>  
      
        <h3> Button pressed :  <%=request.getParameter("btn")%></h3>        
   </body>
</html>
If I change the method from POST to GET the code works.

Why is this happening?