/**
* 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();
}
}
CrawlerServlet.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:CrawlerSYS
作者:
评论列表
文章目录