Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


virtual directory

Posted on 2005-03-24
Medium Priority
Last Modified: 2013-11-18

From a JSP page how do i get the path to the virtual directory. for example i am including a page from various files that are in various folders and i need to provide an absolute path.. eg


i.e. what do use to get my base applications path

Question by:makerp
  • 2
LVL 10

Author Comment

ID: 13626367
i am using Tomcat
LVL 92

Accepted Solution

objects earned 500 total points
ID: 13626452
use the getRealPath() method of ServetContext (application)
LVL 10

Author Comment

ID: 13628863
ah - this is what i need request.getContextPath(), i need the virtual directory name, getRealPath() gets the disk path which is not what i want..

i will accpet your answer anyway as you lead me to the HttpServletRequest class which is where i found what i wanted


Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logiā€¦
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question