• Post Reply Bookmark Topic Watch Topic
  • New Topic

Find web application root path?

 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm deploying a web application to, say, ${TOMCAT.HOME}/webapps/[app.name].

Within the various JSPs and HTML files, I need to reference external script and css files, located in ${TOMCAT.HOME}/webapps/[app.name]/css.

How can I determine the location of this directory, in a way that, when I change the value of [app.name], it doesn't break the application? I basically need to be able to do something like this in my HTML:


Any ideas?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the current web app:

${pageContext.request.contextPath}

for other web apps? No can do.
 
Leoo yu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be use ***.propeties to store these projest parameter .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!