1,新建web 测试项目并且发布到Tomcat,访问路径: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,