You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thomas Heigl <th...@umschalt.com> on 2012/05/09 10:56:52 UTC

Wicket 1.5.6 Relative URL rendering

Hello,

Since Wicket 1.5.6, the UrlRender generates all URLs prefixed with "./"
when using RequestCycle.get().urlFor(pageClass). The Problem is that for my
application's homepage the generated URL is "./." which does not really
make sense.

Is there any reason for doing this? What caused the change to relative URL
rendering?

Cheers,

Thomas

Re: Wicket 1.5.6 Relative URL rendering

Posted by Martin Grigorov <mg...@apache.org>.
to create an absolute url use:

requestCycle.getUrlRenderer().renderFullUrl(relativeUrl.toString())


On Wed, May 9, 2012 at 12:07 PM, Thomas Heigl <th...@umschalt.com> wrote:
> Hey Martin,
>
> Thanks for the explanation!
>
> How exactly the home page is broken ? Do you have custom RequestMapper
>> for the home page ?
>
>
> The problem is in absolute URL generation. I generate absolute URLs for
> sitemaps, canonical URL tags etc and my logic broke after upgrading to
> Wicket 1.5.6 because my "URL absolutizer" was confused by "./."  for the
> homepage.
>
> I don't use a request mapper for the homepage. Would it solve the problem
> to mount the homepage under "/"?
>
> Cheers,
>
> Thomas
>
> On Wed, May 9, 2012 at 11:00 AM, Martin Grigorov <mg...@apache.org>wrote:
>
>> Hi,
>>
>> They have always been relative.
>> Before 1.5.6: some/relative/url
>> After 1.5.6: ./somerelative/url
>>
>> Both are the same. The reason is
>> https://issues.apache.org/jira/browse/WICKET-4260
>>
>> How exactly the home page is broken ? Do you have custom RequestMapper
>> for the home page ?
>>
>> On Wed, May 9, 2012 at 11:56 AM, Thomas Heigl <th...@umschalt.com> wrote:
>> > Hello,
>> >
>> > Since Wicket 1.5.6, the UrlRender generates all URLs prefixed with "./"
>> > when using RequestCycle.get().urlFor(pageClass). The Problem is that for
>> my
>> > application's homepage the generated URL is "./." which does not really
>> > make sense.
>> >
>> > Is there any reason for doing this? What caused the change to relative
>> URL
>> > rendering?
>> >
>> > Cheers,
>> >
>> > Thomas
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 1.5.6 Relative URL rendering

Posted by Thomas Heigl <th...@umschalt.com>.
Hey Martin,

Thanks for the explanation!

How exactly the home page is broken ? Do you have custom RequestMapper
> for the home page ?


The problem is in absolute URL generation. I generate absolute URLs for
sitemaps, canonical URL tags etc and my logic broke after upgrading to
Wicket 1.5.6 because my "URL absolutizer" was confused by "./."  for the
homepage.

I don't use a request mapper for the homepage. Would it solve the problem
to mount the homepage under "/"?

Cheers,

Thomas

On Wed, May 9, 2012 at 11:00 AM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> They have always been relative.
> Before 1.5.6: some/relative/url
> After 1.5.6: ./somerelative/url
>
> Both are the same. The reason is
> https://issues.apache.org/jira/browse/WICKET-4260
>
> How exactly the home page is broken ? Do you have custom RequestMapper
> for the home page ?
>
> On Wed, May 9, 2012 at 11:56 AM, Thomas Heigl <th...@umschalt.com> wrote:
> > Hello,
> >
> > Since Wicket 1.5.6, the UrlRender generates all URLs prefixed with "./"
> > when using RequestCycle.get().urlFor(pageClass). The Problem is that for
> my
> > application's homepage the generated URL is "./." which does not really
> > make sense.
> >
> > Is there any reason for doing this? What caused the change to relative
> URL
> > rendering?
> >
> > Cheers,
> >
> > Thomas
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket 1.5.6 Relative URL rendering

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

They have always been relative.
Before 1.5.6: some/relative/url
After 1.5.6: ./somerelative/url

Both are the same. The reason is
https://issues.apache.org/jira/browse/WICKET-4260

How exactly the home page is broken ? Do you have custom RequestMapper
for the home page ?

On Wed, May 9, 2012 at 11:56 AM, Thomas Heigl <th...@umschalt.com> wrote:
> Hello,
>
> Since Wicket 1.5.6, the UrlRender generates all URLs prefixed with "./"
> when using RequestCycle.get().urlFor(pageClass). The Problem is that for my
> application's homepage the generated URL is "./." which does not really
> make sense.
>
> Is there any reason for doing this? What caused the change to relative URL
> rendering?
>
> Cheers,
>
> Thomas



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org