String path = code.getClass().getClassLoader().getResource("").getPath();//获取静态资源路径 System.out.println(path);//这里获取的path还要加个static。和传统项目有点不同。 ImageIO.write(image,"jpg",new File(path+"static/images/image.jpg"));
String path = code.getClass().getClassLoader().getResource("").getPath();//获取静态资源路径 System.out.println(path);//这里获取的path还要加个static。和传统项目有点不同。 ImageIO.write(image,"jpg",new File(path+"static/images/image.jpg"));