Hi,
 
We have just changed the way we deploy our webapp. We previously were putting our app into the ROOT folder under webapps Sad smile, not good I know.
We now package the app as a war file called myapp.war and place it into the webapps folder where it explodes into a folder called myapp. Everything
works except for one thing. Our app has the option to let the user change the look & feel of the web app using predefined skins which we store in a
folder called templates inside the myapp folder. Inside the templates folder are the folders that represent all the various skins (skin1, skin2 etc ..).
These skin folders contain all the jsps, the css file and images that represent the content of each skin.
 
Here’s the problem which is easily remedied but I want to know why. Let me explain. All the skins work except image references in the style sheet (css)
cannot be found. Yet images referenced in the jsps are found ! The references to the images begin with the url /templates/skin1/images/image1.png in both the
css case and the jsp case. Now to fix the problem I change the url in the style sheet by adding my app name in front (i.e. /myapp/templates/skin1/images/image1.png)
and this fixes the problem.
 
I have no problem with changing this and it’s even logical. I’m just trying to understand why this only has presented a problem with links in the css and not the jsps.
In firebug the reference to images already have my app name prepended to the images automatically. (i.e. /myapp/templates/skin1/images/image2.png) YET the jsps’
references only begin the url /templates/skin1/images/image1.png (no prepended app name)
 
I’m just wondering if this make sense to someone with Tomcat experience. Is there a hard and fast rule here I’m missing. What’s best practice ?
 
Thanks in advance
Pat
 

Reply via email to