Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

absolute path  RSS feed

 
saintmacai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!
if i have this address in my server:
"http//localhost/folder1/folder2/testfile.html"
how can i extract its absolute or physical path?
i know in asp you can use the MapPath method of the Server class.
How can i do this in jsp?
thanks
ellai
 
James Moore
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the servlet context there is a getRealPath(String) method that should do what you want. The context is the object named "application" in JSPs.
Regards
James
 
saintmacai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply james.
can i do this without using servlets.
Im using JSP. Are they the same thing.
Can you please give sample codes in JSP for my question.
thanks!
ellai
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"saintmacai"
Your name doesn't follow the javaranch guidelines.
Please take a moment and change your "Publicly Displayed Name", by modifying your profile, to follow the guidelines available at http://www.javaranch.com/name.jsp
thanks for your cooperation.
- sayta
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!