配置servlet的另类改写
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
//重写HttpServlet中的service方法
@WebServlet(name = "ServletDemo")
public class ServletDemo extends HttpServlet {
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) {
System.out.println("666");
}
}
响应成功,方法有点另类,不过用起来很方便🤭