//读取配置文件
String path=request.getServletContext().getRealPath("/config/sysconfig.properties");
Properties pro = new Properties();
pro.load(new FileInputStream((path)));
String url=pro.getProperty("elasticsearch.url");
String path=request.getServletContext().getRealPath("/config/sysconfig.properties");
Properties pro = new Properties();
pro.load(new FileInputStream((path)));
String url=pro.getProperty("elasticsearch.url");
String index_name=pro.getProperty("elasticsearch.index");
//配置文件位置
本文详细介绍了如何从配置文件中读取Elasticsearch的URL和索引名称,并将其应用于系统设置。
655

被折叠的 条评论
为什么被折叠?



