-3

I can use Servlet, it is nothing wrong: enter image description here

this is my Servlet code: enter image description here

Configuration of web.xml: enter image description here

But when I use HttpServlet, the mistake happened: enter image description here

this is My HttpServlet code: enter image description here

and this is Configuration of it: enter image description here

I already inspect the things all i imagine. I have found a lot of places that have no results, I am a senior high school student in grade two, If the text is in a mess, I'm sorry, I don't know why the pictures in here will be links. Whether you can help me or not, I still want to thank you for see it.

李雨泽
  • 3
  • 4
  • 5
    Hello and welcome to SO. Please avoid to put image links in your questions, and put your code snippets instead, otherwise you might not have much help here... – DamCx May 09 '18 at 08:45
  • Please read [mcve] and enhance your question accordingly. Be careful about just dropping all your code here. Rather focus on getting some minimal, yet complete enough thing together! And you absolutely do put up **code** as screen shots. Anything that is **text** should be **formatted text**. – GhostCat May 09 '18 at 09:00

1 Answers1

1

The problem is this line:

   super.doGet(req, resp);

This is delegating to the default implementation of doGet provided by the HttpServlet class. The problem is that that version of doGet is version that is used when you don't implement your own doGet, and its behavior is to tell the remote client that GET is not supported by the servlet.

Solution: remove that call.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216