This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JSF and the fly likes FileNotFoundException with relative path 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 » Java » JSF
Bookmark "FileNotFoundException with relative path" Watch "FileNotFoundException with relative path" New topic

FileNotFoundException with relative path

Dhannya Zacharia

Joined: Aug 13, 2007
Posts: 12

I am having an action class and inside my action class i want to refer to an html file in the following directory : webContent/templates/check.html.

I am able to access this file if i specify absolute path, but when i give relative path, it gives a FileNotFoundException.

How do i solve this?

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

I was able to do this through the ServletContext


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Dhannya Zacharia

Joined: Aug 13, 2007
Posts: 12
Thanks Mark
subject: FileNotFoundException with relative path
It's not a secret anymore!