You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Magnus Haraldsen Amundsen <Ma...@computas.com> on 2008/02/25 13:02:12 UTC
Problems with images and CSS in modularized Cocoon webapp
I have a very basic problem, which concerns images and CSS used in the XSLT's. Somehow the CSS and images aren't found/read.
Our directory structure is as follows: https://submarine.computas.com/sublima/trunk/
We have a sitemap.xmap located in https https://submarine.computas.com/sublima/trunk/blocks/sublima-skin/src/main/resources/COB-INF/sitemap.xmap
which contains matchers (with map:read) for images/*.png etc. so that references to img src="images/detektor_beta_header.png" is looked for in resources/images/ using the read src="resources/images/{1}.png"
The same goes for the CSS, and the image and css is refered to in https://submarine.computas.com/sublima/trunk/blocks/sublima-skin/src/main/resources/COB-INF/transform/alt-styling.xslt
using <link rel="stylesheet" type="text/css" href="styles/alt-css.css"/>
and <img src="images/detektor_beta_header.png"/>
We package the webapp and run it on Tomcat 5.5.
I couldn't find anything in the documentation, and the samples don't seem to cover these aspects of Cocoon neither.
Most likely it's because Cocoon packages the individual blocks as JAR contained in the webapp WAR, and the webapp doesn't have access to the resources within the JAR? How to solve this?
(As for the moment, the CSS and image refs are commented out in the alt-styling.xslt).
Med vennlig hilsen
Magnus Haraldsen Amundsen
Kunnskapsingeniør
Mobil: 920 95 243
Epost: magnus.amundsen@computas.com <ma...@computas.com>
Web: www.computas.com <http://www.computas.com/>
| COMPUTAS SETTER KUNNSKAP I SYSTEM |
Computas AS Vollsveien 9, Postboks 482, 1327 Lysaker | Telefon: 6783 1000 | Faks: 6783 1001
IMPORTANT NOTICE:
This message may contain confidential information.
If you have received this e-mail in error, do not use, copy or
distribute it. Do not open any attachments. Delete it immediately from
your system and notify the sender promptly by e-mail that you
have done so. Thank you.
RE: Problems with images and CSS in modularized Cocoon webapp
Posted by "Binkley, Peter" <Pe...@ualberta.ca>.
Are you using the resource: protocol in your map:read references?
e.g. <map:read src="resource://org/apache/cocoon/{2}/resources/{3}"/>
The Forms block samples provide examples of this kind of usage.
Peter
________________________________
From: Magnus Haraldsen Amundsen [mailto:Magnus.Haraldsen.Amundsen@computas.com]
Sent: Monday, February 25, 2008 5:02 AM
To: users@cocoon.apache.org
Subject: Problems with images and CSS in modularized Cocoon webapp
I have a very basic problem, which concerns images and CSS used in the XSLT's. Somehow the CSS and images aren't found/read.
Our directory structure is as follows: https://submarine.computas.com/sublima/trunk/
We have a sitemap.xmap located in https https://submarine.computas.com/sublima/trunk/blocks/sublima-skin/src/main/resources/COB-INF/sitemap.xmap
which contains matchers (with map:read) for images/*.png etc. so that references to img src="images/detektor_beta_header.png" is looked for in resources/images/ using the read src="resources/images/{1}.png"
The same goes for the CSS, and the image and css is refered to in https://submarine.computas.com/sublima/trunk/blocks/sublima-skin/src/main/resources/COB-INF/transform/alt-styling.xslt
using <link rel="stylesheet" type="text/css" href="styles/alt-css.css"/>
and <img src="images/detektor_beta_header.png"/>
We package the webapp and run it on Tomcat 5.5.
I couldn't find anything in the documentation, and the samples don't seem to cover these aspects of Cocoon neither.
Most likely it's because Cocoon packages the individual blocks as JAR contained in the webapp WAR, and the webapp doesn't have access to the resources within the JAR? How to solve this?
(As for the moment, the CSS and image refs are commented out in the alt-styling.xslt).
Med vennlig hilsen
Magnus Haraldsen Amundsen
Kunnskapsingeniør
Mobil: 920 95 243
Epost: magnus.amundsen@computas.com <ma...@computas.com>
Web: www.computas.com <http://www.computas.com/>
| COMPUTAS SETTER KUNNSKAP I SYSTEM |
Computas AS Vollsveien 9, Postboks 482, 1327 Lysaker | Telefon: 6783 1000 | Faks: 6783 1001
IMPORTANT NOTICE: This message may contain confidential information. If you have received this e-mail in error, do not use, copy or distribute it. Do not open any attachments. Delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank you.