[opencms-dev] combining JSP an JavaScript + [edit: and CSS]
Jonathan Woods
jonathan.woods at scintillance.com
Sun Feb 4 13:17:01 CET 2007
It's not that unconventional - after all, all it means is there may need to
be some element of the CSS which is dynamic.
However, you may find a problem if you expect a CSS to be loaded on each
request. Browsers tend to cache linked stylesheet files for longer than
they're meant to, in my experience, so you can't reliably use a CSS for the
purpose you describe. Instead, you could make the background style part of
the main page itself ("<body style="background: url(....)" ).
Jon
_____
From: sfdbfoui at host2.scintillance.com
[mailto:sfdbfoui at host2.scintillance.com] On Behalf Of Volkmar Emberger
Sent: 04 February 2007 08:17
To: The OpenCms mailing list
Subject: Re: [opencms-dev] combining JSP an JavaScript + [edit: and CSS]
do you think it is very "unconventional" if I mix JSP and CSS?
like different background images on every load of the css?
best regards volkmar
Scott Carlson schrieb:
The key is that the OpenCms type needs to be JSP. The extension in the
name can still be "js" (i.e. it need not have a "jsp" extension).
I do this all the time. In fact, all my normal jsp pages have an
extension of "html" instead of "jsp". OpenCms is nice in the fact that
it handles the complexity of using the "wrong" extension for jsp pages
behind the scenes.
Scott
-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Guillaume Lederrey
Sent: Thursday, February 01, 2007 6:25 AM
To: The OpenCms mailing list
Subject: Re: [opencms-dev] combining JSP an JavaScript
I thought the cms-tags will be inserted with the information before
the
script is sended to the client
so why is it working with css but not with javascript?
I havent tried it myself but ...
A ".js" file sould be treated as a simple resource, and should not
be interpreted by OpenCms. If you want to have dynamic content inside
you .js file, you should declare it as a JSP file. You can than
include "myJavaScript.jsp" in your template and it should work.
Good luck
Guillaume
--
Mit freundlichen Grüßen
Volkmar Emberger
Diplomand
e-tecture GmbH
Hirschstraße 2
76133 Karlsruhe
Tel: +49 721 570458-17
Fax: +49 721 1205468
volkmar.emberger at e-tecture.com
www.e-tecture.com
e-tecture GmbH
Darmstädter Landstraße 112
60598 Frankfurt am Main
Amtsgericht Frankfurt am Main
HRB 56449
Gesellschaft mit Sitz in Frankfurt am Main
Geschäftsführer: Christian Schwab
Diese e-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese e-Mail irrtuemlich
erhalten
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese
e-Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser e-Mail ist
nicht gestattet.
This e-Mail may contain confidential and/or privileged information. If you
are not
the intended recipient (or have received this e-Mail in error) please notify
the sender
immediately and destroy this e- Mail. Any unauthorized copying, disclosure
or
distribution of the material in this e-Mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070204/8b32470a/attachment.htm>
More information about the opencms-dev
mailing list