File f = new File(filePath)  f.exists() 为false 求大神
现在是做头像剪切,先传一张在服务器,resources\upload\2011\10\12\123.png  , 然后将这路径放到页面显示,截取后将resources\upload\2011\10\12\123.png 传入action,
在用 ServletActionContext.getRequest().getRealPath("")+resources\upload\2011\10\12\123.png                       
得到的路径为:
String filaPath=F:\编程工具安装包\Tomcat\apache-tomcat-6.0.26-windows-x64\apache-tomcat-6.0.26\webapps\mmshuxia/resources/upload/2011/10/12/20115012175032CgSis6e.png
将上面的路径放硬盘里查找,文件存在
然后  File f = new File(filaPath);
       System.out.println(f.exists());
输出为  false
下面是tomcate配置:
<Connector port="8080" protocol="HTTP/1.1"  
                connectionTimeout="20000"  
                redirectPort="8443" URIEncoding="utf-8"   useBodyEncodingForURI="true"/>  
------解决方案--------------------
System.getProperty("catalina.home")
获取到tomcat服务的路径
------解决方案--------------------
Java code
ClassLoader.getSystemResourceAsStream()