File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes Real File Path in eclipse 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 » Engineering » IDEs, Version Control and other tools
Bookmark "Real File Path in eclipse" Watch "Real File Path in eclipse" New topic

Real File Path in eclipse

Sudhanshu Mishra
Ranch Hand

Joined: May 28, 2011
Posts: 235

I want to save an image in my WebContent/images folder in the dyanamic web project I am working on.
Problem is, in a JSP when I use

what I get is "D:\Eclipse\ScriptPerfect\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ScriptPerfect\WebContent\images ".

Still the image doesn't show in the WebContent directory.

I want it to be simply "D:\Eclipse\ScriptPerfect\Webcontent\images"....

Please correct me if I am wrong and help me out.


Peter Johnson

Joined: May 14, 2008
Posts: 5852

No, you really don't want that. You really want the first path - that reflects where your wep app is running. Thus your web app was deployed to D:\Eclipse\ScriptPerfect\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ScriptPerfect\WebContent, so you want the code to look within that directory (or a subdirectory) for all contents.

Did you look in D:\Eclipse\ScriptPerfect\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ScriptPerfect\WebContent\images to see if the image you want is there? Eclipse should have copied it (and the rest of the web contents) from D:\Eclipse\ScriptPerfect\WebContent (assuming that your workspace is d:\Eclipse and that your project's name is ScriptPerfect).

JBoss In Action
I agree. Here's the link:
subject: Real File Path in eclipse
It's not a secret anymore!