Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to know the directory from which a jsp was requested

 
Gaurav Kalra
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic