且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

来自 Web 服务的推送通知

更新时间:2022-04-30 23:12:37

完成此任务的步骤 -

  1. 创建一个 servlet 并在部署描述符中注册它
  2. 覆盖servlet
  3. init方法
  4. 创建一个线程并在init 方法中启动它.使用while循环无限执行来做监控任务
  5. 最重要 - 通过将以下行添加到部署描述符中,在服务器启动期间强制 servlet 初始化.此链接中的信息 - http://jersey.576304.n2.nabble.com/Initialization-at-startup-as-opposed-to-first-request-td5164440.html
  1. Create a servlet and register it in the deployment descriptor
  2. Override the init method of the servlet
  3. Create a thread and start it in the init method. Use a while loop to execute infinitely to do the monitoring task
  4. Most important - force the servlet initialization during server startup by adding the following line to the deployment descriptor. Info at this link - http://jersey.576304.n2.nabble.com/Initialization-at-startup-as-opposed-to-first-request-td5164440.html