摘要: 在spring编程过程中,多线程中是我们经常使用的,但是在线程中,我们是无法通过@Autowired注解来注入我们想要的bean的,所以需要向另外的方法来实现,下面是两种实现方式 1、通过线程的构造函数将需要的bean在构造线程的时候通过调用者注入bean,通过构造函数注入相应bean来实现 2、通 阅读全文
posted @ 2020-04-04 20:58 hik.wolf 阅读(638) 评论(0) 推荐(1)
摘要: 通过new String(fileConfig.getPath().getBytes("ISO-8859-1"), "UTF-8")将其转为utf-8编码就能正确显示中文而避免出现乱码 阅读全文
posted @ 2019-12-26 09:38 hik.wolf 阅读(784) 评论(0) 推荐(0)
摘要: /** * 创建索引 */public static void createIndex(JestClient client, String index) { try { JestResult result = client.execute(new CreateIndex.Builder(index) 阅读全文
posted @ 2019-12-06 14:31 hik.wolf 阅读(987) 评论(0) 推荐(0)