Lyallex
2009-06-11 04:43:43 UTC
Hi
apache-tomcat-6.0.16
jdk1.6.0_03
Dev box : Windows
Deployment box: Linux
I have my server installed at
C:\servers\tomcat\apache-tomcat-6.0.16\
My application is installed at
C:\servers\tomcat\apache-tomcat-6.0.16\webapps\ROOT
I have an image cache available at
C:\servers\tomcat\apache-tomcat-6.0.16\webapps\ROOT\imagecache
In a servlet I do the following
String pathToImagecache = getServletContext().getRealPath("imagecache");
logger.log(Level.INFO, "The path to the image cache is " + pathToImagecache);
The logging output gives the following
INFO: The path to the image cache is
C:\servers\tomcat\apache-tomcat-6.0.16\temp\1-ROOT\imagecache
I need to get hold of the imagecache directory to write images to it
but I have no idea what this \temp\1-ROOT\ bit of the path all about
???
The only way I can get the correct path at the moment is to set up an
EV in context.xml then do a JNDI lookup in my site cooker and save the
value to my config server... I'd much rather use getRealPath as I
don't have to change the config when I deploy to live.
I'm confused, any help much appreciated
lyallex
apache-tomcat-6.0.16
jdk1.6.0_03
Dev box : Windows
Deployment box: Linux
I have my server installed at
C:\servers\tomcat\apache-tomcat-6.0.16\
My application is installed at
C:\servers\tomcat\apache-tomcat-6.0.16\webapps\ROOT
I have an image cache available at
C:\servers\tomcat\apache-tomcat-6.0.16\webapps\ROOT\imagecache
In a servlet I do the following
String pathToImagecache = getServletContext().getRealPath("imagecache");
logger.log(Level.INFO, "The path to the image cache is " + pathToImagecache);
The logging output gives the following
INFO: The path to the image cache is
C:\servers\tomcat\apache-tomcat-6.0.16\temp\1-ROOT\imagecache
I need to get hold of the imagecache directory to write images to it
but I have no idea what this \temp\1-ROOT\ bit of the path all about
???
The only way I can get the correct path at the moment is to set up an
EV in context.xml then do a JNDI lookup in my site cooker and save the
value to my config server... I'd much rather use getRealPath as I
don't have to change the config when I deploy to live.
I'm confused, any help much appreciated
lyallex