IK配置远程自定义词典热更新词库

@RequestMapping("esword")
@ResponseBody
public void inertEsWord(HttpServletRequest request, HttpServletResponse response){

String content = "星星之火可以燎原";

// 返回数据
OutputStream out= null;
try {
out = response.getOutputStream();
response.setHeader("Last-Modified", String.valueOf(content.length()));

response.setHeader("ETag",String.valueOf(content.length()));

response.setContentType("text/plain; charset=utf-8");

out.write(content.getBytes("utf-8"));

out.flush();
} catch (IOException e) {
e.printStackTrace();
}
LOGGER.info(content+"这是读取数据值");
}
posted @ 2020-06-15 17:36  大梦千年  阅读(1159)  评论(0编辑  收藏  举报