This is per the spec which explicitly states that the method
getRealPath() will return null if the webapp is executed from an
unexpanded .war file. I believe it's even in the docs for the servlet
api. If however your effort is in just reading the resource, there are
other methods which work regardless of being in a .war file or not --
getResource( path ) and getResourceAsStream( path ).
--David
Mark Miller wrote:
,
you could use ServletContext.getRealPath( ). That will return the
absolute path to the file, but only if the webapp isn't packed up as
.war.
--David
Why is this the case? Doesn't Tomcat extract to war to a webapp/warname
folder when it first accesses it?
- Mark
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]