前端请求servlet代码 创建类写servlet代码,使得它继承父类HttpServlet 编写web.xml文件来注册 <url-pattern> </url-pattern> 中间写的路径跟你前台的路径保持一致