Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Servlets
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Servlets
full path
Balaji Loganathan
author and deputy
Posts: 3150
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Is it possible to get full contextPath that is
if we have a context like
http://localhost:8080/examples/servlet/HelloWorldExample
Now is it possible to retrieve the physical location of examples folder. ?
say like C:\Tomcat\webapps\examples
Regards
Balaji
Anthony Villanueva
Ranch Hand
Posts: 1055
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Use getRealPath() of ServletContext.
Balaji Loganathan
author and deputy
Posts: 3150
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Anthony,It worked for me.
System.out.println("Actual Path=>" +getServletContext().getRealPath(""));
Now looking at the
servlet
api's to learn more tricks.
Regards
Balaji
Spritle Software Blogs
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Error 404: File not found: loadservlet
executing servlets in apache tomcat
A Servlet That Uses Packages and Utilities
problem in running a servlet
I am not able to Run Head First servlet example
More...