CrawlerServlet.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:CrawlerSYS 作者:
/**
 * Initialization of the servlet. <br>
 *
 * @throws ServletException if an error occurs
 */
public void init() throws ServletException {
    String file = this.getServletContext().getRealPath(this.getInitParameter("log4j"));
    //从web.xml配置读取,名字一定要和web.xml配置一致
      if(file != null){
         PropertyConfigurator.configure(file);
      }
    // Put your code here
    new CrawlerServer(DefaultConfig.serverPort).start();
    try {
        new WebSocket(DefaultConfig.socketPort).start();
    } catch (UnknownHostException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号