In your JSP, you can use application.getRealPath("/"). In your servlet, use the ServletContext.getRealPath("/").
One thing to note is that not all containers deploy your application by exploding them into certain directory. Some is using the WAR/EAR file as a whole.
SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
raj baig
Ranch Hand
Joined: Jul 11, 2006
Posts: 96
posted
0
in case of war file can you tell me how to achieve the path
Depends what you want to do. If you want to write/edit files, it is not so easy. If you are looking to read from a file, you can (usually) use the ClassLoader to find an InputStream from files in the WAR/EAR
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.