名字不是主要的
创建一个测试的【servlet】
package com.item.servlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @WebServlet("/GetInfo") public class GetInfoServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doPost(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { System.out.println("success"); } }
改成根路径
访问完有显示,说明成功。
到此这篇关于idea配置tomcat必坑指南的文章就介绍到这了,更多相关idea配置tomcat内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
相关文章: