String filePath = getClass().getResource("/static/doc/" + fileName).getPath(); //在平时项目中使用无问题 但是打成jar后 路径会变化
//最简单的办法是将要下载的文件放在jar包的同级目录下
String filePath = "./" + fileName;
String filePath = getClass().getResource("/static/doc/" + fileName).getPath(); //在平时项目中使用无问题 但是打成jar后 路径会变化
//最简单的办法是将要下载的文件放在jar包的同级目录下
String filePath = "./" + fileName;