Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes servlet API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "servlet API" Watch "servlet API" New topic

servlet API

Ishita Saha
Ranch Hand

Joined: May 30, 2007
Posts: 39

I'm working on an intranet site project.I've to write a servlet to store some temp files on the machine.
For that i need to get the temp folder location at run time. I want to use relative path for that.

So lets say for my sandbox setup, the application is deployed on tomcat in the location:


and i want to save the temp files in a folder tempupload under fstkservices. So my question is that how do i get the above location in my servlet code. Is there any API to get the root location of where the application is deployed?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Please do not crosspost the same question in different forums. Thank you.
Refer to your original thread here :

[My Blog]
All roads lead to JavaRanch
Ishita Saha
Ranch Hand

Joined: May 30, 2007
Posts: 39
i'm sorry for that, just wanted to have an early reply. thanks.
I agree. Here's the link:
subject: servlet API
It's not a secret anymore!