Spring boot 通过注解注册Servlet组件
以前在web.xml
FirstServlet *
com.bjsxt.servlet.FirstServlet
FirstServlet
/first
//spring boot 整合 servlet
@WebServlet(name="FirstServlet",urlPatterns="/first") public class FirstServlet extends HttpServlet {
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
System.out.pringln("servlet");
} }