• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting Installation Path of Webserver

 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,
I'm using JSP and Oracle for my Application - Human Resource. I got a piece of code where I can upload the images of Employees.

I have a folder in under my application

HumanResource
-- WEB-INF
-- META-INF
-- CSS
-- SCRIPT
-- UPLOAD

In the server the Apache tomcat is installed in the Driver
D:\Program files\Apache\Webapps\humanResource

But my remote server is Linux.

I want a way where I can find the installed directory of the project folder

request.getContextPath() returns the value /humanResource

But I want the full path.

Please help me.. Ranchers

Regards

Aravind Prasad
 
Tarun Yadav
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use ServletContext.getRealPath() but take a look at this discussion first to see if it's really the best way to go: http://www.coderanch.com/t/211165/JSF/java/getRealPath-Depricated

EDIT: Forgot to mention that if you're using a WAR, you'll get null.
[ September 25, 2007: Message edited by: Tarun Yadav ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!