建了个工程Music,写了个jsp实现文件上传时,想把图片存在工程中WebContent/img/book/中,请问su.save("........", su.SAVE_VIRTUAL);中的路径怎么写?
我总出现java.lang.IllegalArgumentException: This path does not exist (1135).异常
建了个工程Music,写了个jsp实现文件上传时,想把图片存在工程中WebContent/img/book/中,请问su.save("........", su.SAVE_VIRTUAL);中的路径怎么写?
我总出现java.lang.IllegalArgumentException: This path does not exist (1135).异常
servlet.getServletContext().getRealPath("/WebContent/img/book");
其中servlet.getServletContext()是获取工程的部署路径
getRealPath("/WebContent/img/book")是获取部署项目中的目录
./webcontentt/img/book/
./WebContent/img/book/