Merge branch 'test6.9.3' of http://git.yoho.cn/platform/platform-cms into test6.9.3
Showing
1 changed file
with
4 additions
and
4 deletions
@@ -42,11 +42,11 @@ public class CMSHtmlController { | @@ -42,11 +42,11 @@ public class CMSHtmlController { | ||
42 | response.setContentType("application/json; charset=UTF-8"); | 42 | response.setContentType("application/json; charset=UTF-8"); |
43 | try{ | 43 | try{ |
44 | //取context下的html文件转成文件流 | 44 | //取context下的html文件转成文件流 |
45 | - String filePath = request.getServletContext().getRealPath(url); | ||
46 | - logger.info("getContentHtml: filePath is {},realPath is {}", filePath, request.getServletContext().getRealPath("/")); | ||
47 | - File f = new File(filePath); | 45 | + String filePath = request.getServletContext().getRealPath("/"); |
46 | + logger.info("getContentHtml: filePath is {}", filePath); | ||
47 | + File f = new File(filePath + url); | ||
48 | logger.info("getContentHtml: file is {}, file path is {}", f, f.getPath()); | 48 | logger.info("getContentHtml: file is {}, file path is {}", f, f.getPath()); |
49 | - fis = new FileInputStream(filePath); | 49 | + fis = new FileInputStream(filePath + url); |
50 | 50 | ||
51 | os = new BufferedOutputStream(response.getOutputStream()); | 51 | os = new BufferedOutputStream(response.getOutputStream()); |
52 | ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); | 52 | ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); |
-
Please register or login to post a comment