Fabrice Dewasmes wrote:
Hi,

Another question : when using velocity, URIs are rendered using $jslink variable. In fact This URI is rendered by the toString Method of a DynamicURI object coming from Turbine. But this gives absolute URI and not relative ones.

For me this is problematic especially when you sit behind a reverse proxy as this is our case, or even when you have custering problematics in mind.


Agreed, it's a pain in those situations when your host name is meaningless.

Is there a simple way to change this behaviour or do I have to rewrite DynamicURI class and simply replace it within turbine jar ? (kind of brute force patch isn't it ;) ?)


Luckily for you we have better options :)

$jslink is actually a reference to class
org.apache.jetspeed.util.template.BaseJetspeedLink

as configured in the TurbineResources.properties

So you can subclass the above class,
rewrite the toString() method not to output the host part of the URL and use your subclass as jslink instead of the default one
by overiding the Turbine tool definition in your my.properties file.


your toString() may look like this:

public String toString()
{
        String url= super.toString();

        return base.substring(url.indexOf('/',url.indexOf("//")+1),url.length);

}

--
Raphaël Luta - [EMAIL PROTECTED]
Apache Portals - Enterprise Portal in Java
http://portals.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to