[opencms-dev] Static and Dynamic Serving of Content

Christian Steinert christian_steinert at web.de
Fri Aug 11 14:45:18 CEST 2006


Michael Kraus schrieb:
> Dear all,
> 
> I have a problem with the static and dynamic serving of content (as
> described in Chapter 8 of the OpenCms 5 book, however, I'm using OpenCms
> 6.0.4).
> 
> Within a self-written template, I read the local path to a style sheet
> from an OpenCms property, which is set once for the whole site, and
> construct an absolute path using CmsJspActionElement.link(). On some
> pages of the site, I get "/opencms/mweb/589/resources/css/default.css"
> as result, on other pages (using the same template), I get
> "/export/sites/default/mweb/589/resources/css/default.css". The latter
> is not working, as that file is not being exported to the local file
> system.
> 
> How can I control the behaviour of that link being generated? Or how can
> I ensure that the file gets exported? I tried to play with the "export"
> property on that file, but without success.
> 
> Kind regards,
>     Michael

Hi Michael,

I must say that I don't understand, why linking to the same resource
will sometimes point to the online and sometimes to the offline version.
This is indeed strange.

Have you checked your export configuration (opencms-vfs.xml)?
The default export handler is CmsOnDemandStaticExportHandler.

This handler has to be called by tomcat. The idea is:
- Tomcat or apache tries to call a page
- page cannot be found because it has not been exported yet
- 404 handler of opencms is called
- the 404 handler of opencms exports the page and redirects

I can only suggest that you search the list archives for
CmsOnDemandStaticExportHandler. I have not yet used this, so I don't
have any information at hand, how the 404 handler is set up.

If you want to pre-export anything, whenever your site is published
(depending on the size of your site publishing will take quite a
while!), then you should go for CmsAfterPublishStaticExportHandler. The
configuration of this handler is described here:
http://lists.opencms.org/pipermail/opencms-dev/2005q4/021164.html)

Also you can export all static resources by hand, from the admin view of
the opencms workplace. (I think somewhere in the DB tools section - not
totally sure)

Regards
christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060811/864f9580/attachment.bin>


More information about the opencms-dev mailing list