往mysql数据库中上传路径问题

  String path = System.getProperty("catalina.home");
                    String fileName = morningTime+"model.docx";
                    path = path+"\\webapps\\JAVA_STU\\office\\templateFile\\"+fileName;
                      path.replace("//", "\\");  //要把斜杠转义一下
                    FileOutputStream outStream = null;
                    
                    outStream = new FileOutputStream(path);
                    document.write(outStream);
                    outStream.close();
                    
                    WordData wordData = new WordData();
                    wordData.setFileUrl(path);
                    wordData.setDataTime(morningTime);
                    wordData.setWordName(fileName);
                    
                    wordDataManager.add(wordData);

posted on 2016-10-14 17:11  guols  阅读(183)  评论(0编辑  收藏  举报