Yes, Caldarale, I do agree that in the spec, there is no word about whether the file should exist (or I miss something anywhere ?), and the spec is always ambigurous :-) As I said in my last post, what makes me feel confusing is that, with current implementation, we never have chance to consider the resources in the META-INF/resources folder.
2010/7/28 Caldarale, Charles R <chuck.caldar...@unisys.com> > > From: Ivan [mailto:xhh...@gmail.com] > > Subject: Re: FileDirContext returns the path directly without checking > > whether the target file really exists > > > > I copied some words from the spec, the the second paragraph, > > it says something about resources in the META-INF/resources > > directory, if we do not need to care about whether the real > > file exists, I think we could never go into this situation, > > we might always have a path in the default context. > > right ? > > No. The resource may or may not exist completely independently of whether > or not the webapp has some location in the file system; you're confusing the > situations. One can use getRealPath() to determine the path for a resource > the webapp wants to /create/, not just one the webapp wants to read. If you > want to see if the path returned points to an existing file, there are ample > APIs in the JRE to let you do so. > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL and is thus for use only by the intended recipient. If you received > this in error, please contact the sender and delete the e-mail and its > attachments from all computers. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > -- Ivan