getResourceAsStream
http://www.cnblogs.com/javayuer/archive/2011/01/02/1924192.html
ServletActionContext.getServletContext().getResourceAsStream(inputPath);
inputPath="D:\\workspace2\\college\\res_base\\dxs_gov_cn_www\\upload\\file\\201212191416131107295.gif";
找不到内容
inputPath="./res_base/dxs_gov_cn_www/upload/file/201212191416131107295.gif";
inputPath="/res_base/dxs_gov_cn_www/upload/file/201212191416131107295.gif";
inputPath="res_base/dxs_gov_cn_www/upload/file/201212191416131107295.gif";
如上3个路径这个可以找到,从web-inf 下开始找。
路径问题:
ServletActionContext.getServletContext().getResourceAsStream(inputPath);
中是从从web-inf 下开始找。
可http://www.cnblogs.com/javayuer/archive/2011/01/02/1924192.html 确说
默认从WebAPP根目录下取资源默认从WebAPP根目录下取资源。待解。