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

How can i get the directory o a JSP file  RSS feed

 
John Ray Allen
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wud like to get as String the directory where the JSP file is deployed in the Application Server..I'd like to hear your ideas..thanks!
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can go for

getServletContext()
getRequestURI()
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext.getRealPath("/") will return the path on the filesystem providing that you are running your app as an exploded file system and not as a packed war file.

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!