Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes how to know the directory from which a jsp was requested Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to know the directory from which a jsp was requested" Watch "how to know the directory from which a jsp was requested" New topic
Author

how to know the directory from which a jsp was requested

Gaurav Kalra
Greenhorn

Joined: Mar 13, 2001
Posts: 27
From inside the jsp code, i want to know what directory it was requested from. How can i do that. Does the getServletContext() provides for it.
Gaurav
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Gaurav,
Assuming this file getRealPath.jsp is stored under C:\jakarta-tomcat\webapps\MISApp\Login\getRealPath.jsp and you invoke it from browser as http://localhost/MISApp/Login/getRealPath.jsp
we will get the real path which is
C:\jakarta-tomcat\webapps\MISApp\Login\getRealPath.jsp
displayed at the browser. Is this what you wanted ?

regds
maha anna


[This message has been edited by maha anna (edited April 05, 2001).]
Gaurav Kalra
Greenhorn

Joined: Mar 13, 2001
Posts: 27
Thanx maha anna,
u've been a great source of inspiration for me. I would like to thank u for answering my question as u r the only one who always reply to my questions.
I've got one more question for which i've not been able to find the answer. Because u r a SCJ2P, can u please guide me how can i see my result on the internet. I've got my candidate ID and registration ID.
I know that this doesn't belongs to this thread, but i think u'll never mind.
Thanx for all the help
Gaurav
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Here is the link to see your SCJP2 score online. http://www.galton.com/~sun/
YOu didn't fully read this page (Tip 14) . Isn't. Just kidding!
http://www.javaranch.com/maha/Preparation_tips/preparation_tips.html
regds
maha anna
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to know the directory from which a jsp was requested
 
Similar Threads
Running a web app with compiled code
mapping JSPs
Struts action path question
Problem with custom tags
how to know the last page visited?