写了一个Struts2 上传文件的小程序,文件会放在images这个folder 下面,
String realpath = ServletActionContext.getServletContext().getRealPath("/images");
结果总是报错。 错误内容为:
严重: Servlet.service() for servlet [default] in context with path [/Strutstest] threw exception [java.io.FileNotFoundException: Source 'C:\Users\shi edison\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\work\Catalina\localhost\Strutstest\upload_11c9e7e7_15bc986eee5__8000_00000000.tmp' does not exist] with root cause
java.io.FileNotFoundException: Source 'C:\Users\shi edison\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\work\Catalina\localhost\Strutstest\upload_11c9e7e7_15bc986eee5__8000_00000000.tmp' does not exist