public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException
{
String uri = request.getRequestURI();
String fileName = uri.substring(1).replaceAll("/", "_")+".json";
//web下的目录
String dir = request.getSession(true).getServletContext().getRealPath("/WEB-INF/pcie_json_data/");
//web目录下的文件
String filePath = dir+"\\"+fileName;
response.setContentType("text/html; charset=UTF-8");
InputStream inputStream = new FileInputStream(filePath);
//利用第三方工具,直接读取文件所有内容
String text = IOUtils.toString(inputStream,"UTF-8");
//通过PrintWriter对象,直接将文件内容输出到页面
PrintWriter out =response.getWriter();
out.println(text);
out.close();
}