Java servets response.getMethod() not working : Hello I am trying to create a simple servlet as follows

    import java.io.*;
    import javax.servlet.*;    
    import javax.servlet.http.*;
    public class Form extends HttpServlet
    {
        public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
        {
         res.setContentType("text/html");
         PrintWriter p=res.getWriter();
         p.println("<html><head></head><body bgcolor=\"red\">The request came from"+req.getMethod()+"</body></html>");
        }

    }

I am taking the request from an html file coded as follows.

   {html}

   {body}

   {form action="http://localhost:8080/Form" method="GET"}

   First Name: {input type="text" name="name"}

   {br }

   {input type="submit" value="Enter"}

   {/form}

   {/body}

   {/html}

