This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Including the web context in CSS file

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
Consider a css rule like :

Is there a way to include the web context path in the previous line (not hard coding it)?
Please not the the previous rule is in a standalone CSS file, so I don't think it is possible to have: ${pageContext.request.contextPath}/images/ul.gif
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could have it replaced at build time. other than that you would have to include it on your jsp page.

Eric
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry but I didn't understand
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no run-time substitution mechanism for css files.

What you have described is a real problem for deploying context-independent css files. Most people just hard-code the path, either in the source file, or during the build.
[ June 01, 2007: Message edited by: Bear Bibeault ]
 
Dom Lassy
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shouldn't this work?
In your jsp:


And then in your file /stylesheets/style.jsp (stylesheet):


[ June 06, 2007: Message edited by: Dom Lassy ]
[ June 06, 2007: Message edited by: Dom Lassy ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic