美文网首页
springboot配置servlet

springboot配置servlet

作者: CXY_XZL | 来源:发表于2020-11-18 21:25 被阅读0次

1.代码

@Slf4j
@WebServlet("/my")
public class MyServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        log.info("doGet...");
        super.doGet(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        log.info("doPost...");
        super.doPost(req, resp);
    }
}
@ServletComponentScan
@SpringBootApplication
public class SpireApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpireApplication.class, args);
    }
}

2.相关

相关文章

网友评论

      本文标题:springboot配置servlet

      本文链接:https://www.haomeiwen.com/subject/qcdhiktx.html