[opencms-dev] AW: Newbie: problem including files stored in module resources
Alexandre Morozov
morozov at codecentric.de
Tue May 8 12:12:29 CEST 2007
Hello Arian,
you need the application- and servlet path in front of the path of the VFS. The "link"-Tag will generate this.
First please import the opencms tag library:
<%@ taglib prefix="cms" uri="/WEB-INF/opencms.tld" %>
Now use <cms:link>:
<cms:link>/system/modules/org.opencms.mymodule/resources/style.css</cms:link>
If you need to append application- and servlet path in your class, use the method link(String) of CmsJspActionElement.
Alex Morozov
--
codecentric GmbH
Grünewalder Str. 29-31
42657 Solingen
Telefon +49 (212) 24 94 318
Fax +49 (212) 24 94 334
Mobil +49 (151) 167 06 497
eMail morozov at codecentric.de
Internet http://www.codecentric.de
Geschäftsführer: Peter Gierse, Mirko Novakovic und Rainer Vehns Sitz der Gesellschaft: Solingen
Registergericht: Amtsgericht Wuppertal, HRB 19214
-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Arian Abrahantes Quintana
Gesendet: Dienstag, 8. Mai 2007 10:56
An: The OpenCms mailing list
Betreff: Newbie: problem including files stored in module resources
Dear all:
>From my previous post you can see I am a newbie to opencms 6. At the moment I am trying to import a layout from opencms 5 to 6. I followed the instructions on the manual pages (quite usefull) for migration issues. I make all the changes needed to get my template working (package definition mainly) everything fine but when in my template when I request the style sheet (under resources) I can not load it. This is the piece of code:
String resPath = "/system/modules/org.opencms.mymodule/resources/";
....
<link rel="stylesheet" type="text/css" href="<%= resPath + "style.css" %>">
Page Contents are diplayed right but no style applied.
any help would be appreciated. TIA,
arian
PS: Is there some problem with the mailing list search engine at opencms.org?. I always get an error when press "go" but when the result is blank. Is this only happening to me?
More information about the opencms-dev
mailing list