[opencms-dev] Static export: relativelinks_in_export + vfs link

Patricio Keilty opencms at colaborativa.net
Wed Feb 16 02:03:55 CET 2005


Hi all,
i´m trying to use relative links in static exported pages, which use vfs 
links to jsp pages, let me explain it with an example:

- i have 2 pages: /test1.html and /test2.html
- /test1.html is a vfs link to a jsp page : /add-ons/elements/test1.html
- /add-ons/elements/test1.html does a redirect to /test2.html by means 
of a <cms:link/>
- /test2.html is a regular html page

graphically......


/test1.html  ------ vfs link -------> /add-ons/elements/test1.html  ( 
redirects to /test2.html via window.location = 
"<cms:link>/test2.html</cms:link>"; )
                                                                               
|
                                                                               
|
/test2.html                               <<----------------------

First tried NOT using relative links as relevant properties in 
opencms.properties show:
...
staticexport.path=export/
...
url_prefix_export=/${WEB_APP_NAME}/export
....
relativelinks_in_export=false

So far, it worked, pointing my browser to 
http://localhost/opencms/export/test1.html redirects me to 
http://localhost/opencms/export/test2.html.
This is export/test1.html resulting code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>

<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.location = "/opencms/export/test2.html";
//-->
</SCRIPT>
</BODY>
</HTML>

Then tried using relative links as for:
...
staticexport.path=export/
...
url_prefix_export=
....
relativelinks_in_export=true

This time accessing http://localhost/opencms/export/test1.html will 
produce a Error 404 page not found; as export/test1.html code is now:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>

<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.location = "../../test2.html";
//-->
</SCRIPT>
</BODY>
</HTML>

A jsp page, /test3.html which has exactly the same code as 
/add-ons/elements/test1.html will produce the following code, which works:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>

<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.location = "test2.html";
//-->
</SCRIPT>
</BODY>
</HTML>

The problem seems to be that relative links replacement is done on the 
actual resource, the jsp page under /add-ons/elements, and not on the 
vfs link page ( /test1.html ). Is there any way to achieve this? Can´t 
afford to move jsp pages where regular html pages, that´s why i´m using 
vfs links in first place.

Any hints ?
( Using ver. 5.0.1 )

Regards

-- 
Patricio Keilty
Colaborativa.net




More information about the opencms-dev mailing list