1, the new web test project and published to Tomcat, access path: http://127.0.0.1:8080/JvmWeb/index
@WebServlet("/index") public class HelloServlet extends HttpServlet { private AtomicInteger count = new AtomicInteger(0); @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { System.out.println(count.incrementAndGet()); } }
2,