@SpringBootApplication
@ServletComponentScan
public class Application1_7 {
public static void main(String[] args) {
SpringApplication.run(Application1_7.class,args);
}
}
@WebServlet(urlPatterns = "/hi")
public class MyServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.getWriter().println("Hey Man");
}
}
@WebServlet(urlPatterns = "/hi", asyncSupported = true)
public class MyServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.getWriter().println("666666666");
}
}
@WebServlet(urlPatterns = "/hi", asyncSupported = true)
public class MyServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
AsyncContext asyncContext = req.startAsync();
asyncContext.start(() ->{
try {
resp.getWriter().println("666666666");
//触发完成
asyncContext.complete();
} catch (IOException e) {
e.printStackTrace();
}
});
}
}
jsonsole
management.endpoints.web.exposure.include=*
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- stra.cn 版权所有 赣ICP备2024042791号-4
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务