Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get real path of /WebContent

843842Sep 8 2009 — edited Sep 8 2009
Hello,

in one of my filters I save a file to WebContent/images/ on certain conditions. It works well since I hardcoded the absolute path to the WebContent
folder as in /home/myname/projects/appxx/WebContent/images, which is obviously ugly.

How can I get the path?

I tried HttpServletRequest.getRealPath(), but it's not the path I need...

Best regards,
Yves
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 6 2009
Added on Sep 8 2009
1 comment
319 views