[OGo-Developer] WOHyperlink href rewriting

Stéphane Corthésy developer@opengroupware.org
Fri, 1 Feb 2008 11:38:31 +0100


Hello,

On Feb 1, 2008, at 12:31 AM, Helge Hess wrote:

> On 31.01.2008, at 18:19, Stéphane Corthésy wrote:
>> While porting a WebObjects app to SOPE, I encountered a problem  
>> with the WOHyperlink element: when it has the 'href' binding set,  
>> it tries to rewrite the passed URL, most of the times:
> ...
>> This means that you cannot pass a '#myAnchor' binding value, nor a  =

>> 'http://some.where.else/' binding value
>
> I cannot follow that argumentation. Why would rewriting affect a #  
> anchor or an absolute URL? If it would, I suppose the rewriting  
> would be b0rked :-)


If I put '#MyAnchor' in href, I don't want the URL to be rewritten  
'http://server/App/wa/test#MyAnchor'.
If I put 'http://another.server.com' in href, WOHyperlink tries an  
fails to rewrite URL. It shouldn't even touch it.


> (I think) the rewriting is just for turning absolute URLs into  
> (short) relative ones. Which has plenty of advantages (size,  
> proxying, static dumps).
>
> Maybe there is a bug in the rewriting itself?


Yes, there is. Href starting with '#' should not be rewritten -  
because if user clicks on such link, browser will reload page - , and  
absolute URLs having a different base than app should not be  
rewritten using app's base.

Stéphane


> Thanks,
>   Helge
> -- 
> Helge Hess
> http://www.helgehess.eu/
>
>
> --
> OpenGroupware.org Developer
> developer@opengroupware.org
> http://mail.opengroupware.org/mailman/listinfo/developer