Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relative path not working in tomcat

Status
Not open for further replies.

FOR111

Programmer
Joined
Sep 29, 2005
Messages
103
Location
MT
Hi All,

I have a servlet application,part of which calls a file from my resources folder through a relative path; ie: resources/myfile.txt . When i compile and test it through junit all works well. The problem arises when i deploy in tomcat. The path it tries to read is d:\tomcat\bin\resources\myfile.txt!! why does it go and look for it there? is there a way, without making it absolute to fix this issue?

Thanks in advance
Nick F
 
YOu should put them (the resource files) in the classes folder of your project.

Christiaan Baes
Belgium

"My old site" - Me
 
That's what i did...and still it doesn't read from there!

my deployment is something like:

WAS
> WEB-INF
> classes
> resources
> com

!! Strange..

Thanks anyways
nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top