The Servlet must meet three conditions to run successfully.

Dark Horse Programmer 2021-11-12 The latest version of JavaWeb Basics Tutorial Episode 94 servlet fails to run successfully

code in blue circle

@WebServlet("/ServletDemo1")

The ones in parentheses must be the same as the class name

 

Dark Horse Programmer 2021-11-12 The latest version of JavaWeb Basics Tutorial Episode 96 Output post, the path in a.html must be, it is also ServletDemo4 instead of demo4

form action="/web-demo/ServletDemo4" method="post">

Meet the conditions in the picture

watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAd2VpeGluXzUxODI1NTg1,size_20,color_FFFFFF,t_70,g_se,x_16

watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAd2VpeGluXzUxODI1NTg1,size_20,color_FFFFFF,t_70,g_se,x_16 Tomact must be as shown in the figure

 

 

watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAd2VpeGluXzUxODI1NTg1,size_14,color_FFFFFF,t_70,g_se,x_16

 The pom.xml must be the same as the content I created in the first article. Don’t add port: 80 like in Dark Horse Programmer.

Run successfully

 

 

 

 

 

Guess you like

Origin blog.csdn.net/weixin_51825585/article/details/123300534