Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

how I can read file from tomcat 6.0.18 s temp directory ?

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiiii to All

i am not able to read image file from tomcat directory on my jsp ......

is there any solution for this problem...?
i use System.getenv("CATALINA_HOME") For getting tomcat directory path......
but i am in my context scope...
due to i m not able to read that image file........

is there any solution for this.???

thanks in advance .......

Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please paste the code that you are using and the directory structure where the image file is.
Posts: 21720
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting mixed messages here. If you want the temp directory that your tomcat app is using, use the tempfile facilities or look at the tempfile System property. Tomcat will setup that property when it starts and the tempfile functions will use it. You don't need to code Tomcat-specific references, just general tempfile stuff.

The tomcat application directory on the other hand is a different matter. Among other things, it's not actually guaranteed to even be a directory. For finding stuff in your WAR, use the classpath resources functions. But just to repeat, DON'T let your application write files into the WAR itself. Even when it works it's trouble.
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!