You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Bas Gooren <ba...@iswd.nl> on 2011/09/14 21:12:38 UTC

LocaleFirstMapper in wicket 1.5

Hi all,

I'm in the process of migrating our internal code library to 1.5.
So far the main feeling is: wow, most things became a lot easier and 
cleaner.
In other words: thanks wicket team!

Now on to my question: If I look at the LocaleFirstMapper [1] in 
wicket-examples, I see that in #getCompatibilityScore() it forwards the 
call to the chain.
For as far as I can see this would not work, since most mappers (if not 
all) have their own getCompatibilityScore() based on the amount of 
matching segments from the start of the url.

So in other words: by not stripping the locale from the request url 
before forwarding the call to the chain, will this not result in a 0 
score for all mappers?

Sebastian

[1] 
http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5-M3/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java/?v=source 


Re: LocaleFirstMapper in wicket 1.5

Posted by Bas Gooren <ba...@iswd.nl>.
So does that mean that all urls generated by mapHandler() are relative 
to the wicket filter, and are later made relative to the current page url?

When looking at RequestCycle.urlFor() and UrlRenderer it appears this way.

Op 15-9-2011 14:00, schreef Martin Grigorov:
> The code that makes the Url relative is executed after
> #mapHandler(IRequestHandler)
>
> On Thu, Sep 15, 2011 at 2:49 PM, Bas Gooren<ba...@iswd.nl>  wrote:
>> Another question regarding LocaleFirstMapper: in mapHandler() it always adds
>> the locale as the first segment.
>>
>> In wicket 1.4 a url could start with "../"-strings in the
>> IRequestCodingStrategy.encode() call.
>> Wicket would generate a relative url to the wicket filter.
>>
>> Since LocaleFirstMapper always puts the locale at the front, is this no
>> longer the case in 1.5?
>>
>> Sebastian
>>
>> Op 14-9-2011 21:32, schreef Igor Vaynberg:
>>> yes, good catch Bas. please open a jira ticket.
>>>
>>> -igor
>>>
>>> On Wed, Sep 14, 2011 at 12:12 PM, Bas Gooren<ba...@iswd.nl>    wrote:
>>>> Hi all,
>>>>
>>>> I'm in the process of migrating our internal code library to 1.5.
>>>> So far the main feeling is: wow, most things became a lot easier and
>>>> cleaner.
>>>> In other words: thanks wicket team!
>>>>
>>>> Now on to my question: If I look at the LocaleFirstMapper [1] in
>>>> wicket-examples, I see that in #getCompatibilityScore() it forwards the
>>>> call
>>>> to the chain.
>>>> For as far as I can see this would not work, since most mappers (if not
>>>> all)
>>>> have their own getCompatibilityScore() based on the amount of matching
>>>> segments from the start of the url.
>>>>
>>>> So in other words: by not stripping the locale from the request url
>>>> before
>>>> forwarding the call to the chain, will this not result in a 0 score for
>>>> all
>>>> mappers?
>>>>
>>>> Sebastian
>>>>
>>>> [1]
>>>>
>>>> http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5-M3/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java/?v=source
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>
>

Re: LocaleFirstMapper in wicket 1.5

Posted by Martin Grigorov <mg...@apache.org>.
The code that makes the Url relative is executed after
#mapHandler(IRequestHandler)

On Thu, Sep 15, 2011 at 2:49 PM, Bas Gooren <ba...@iswd.nl> wrote:
> Another question regarding LocaleFirstMapper: in mapHandler() it always adds
> the locale as the first segment.
>
> In wicket 1.4 a url could start with "../"-strings in the
> IRequestCodingStrategy.encode() call.
> Wicket would generate a relative url to the wicket filter.
>
> Since LocaleFirstMapper always puts the locale at the front, is this no
> longer the case in 1.5?
>
> Sebastian
>
> Op 14-9-2011 21:32, schreef Igor Vaynberg:
>>
>> yes, good catch Bas. please open a jira ticket.
>>
>> -igor
>>
>> On Wed, Sep 14, 2011 at 12:12 PM, Bas Gooren<ba...@iswd.nl>  wrote:
>>>
>>> Hi all,
>>>
>>> I'm in the process of migrating our internal code library to 1.5.
>>> So far the main feeling is: wow, most things became a lot easier and
>>> cleaner.
>>> In other words: thanks wicket team!
>>>
>>> Now on to my question: If I look at the LocaleFirstMapper [1] in
>>> wicket-examples, I see that in #getCompatibilityScore() it forwards the
>>> call
>>> to the chain.
>>> For as far as I can see this would not work, since most mappers (if not
>>> all)
>>> have their own getCompatibilityScore() based on the amount of matching
>>> segments from the start of the url.
>>>
>>> So in other words: by not stripping the locale from the request url
>>> before
>>> forwarding the call to the chain, will this not result in a 0 score for
>>> all
>>> mappers?
>>>
>>> Sebastian
>>>
>>> [1]
>>>
>>> http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5-M3/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java/?v=source
>>>
>> ---------------------------------------------------------------------
>> 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: LocaleFirstMapper in wicket 1.5

Posted by Bas Gooren <ba...@iswd.nl>.
Another question regarding LocaleFirstMapper: in mapHandler() it always 
adds the locale as the first segment.

In wicket 1.4 a url could start with "../"-strings in the 
IRequestCodingStrategy.encode() call.
Wicket would generate a relative url to the wicket filter.

Since LocaleFirstMapper always puts the locale at the front, is this no 
longer the case in 1.5?

Sebastian

Op 14-9-2011 21:32, schreef Igor Vaynberg:
> yes, good catch Bas. please open a jira ticket.
>
> -igor
>
> On Wed, Sep 14, 2011 at 12:12 PM, Bas Gooren<ba...@iswd.nl>  wrote:
>> Hi all,
>>
>> I'm in the process of migrating our internal code library to 1.5.
>> So far the main feeling is: wow, most things became a lot easier and
>> cleaner.
>> In other words: thanks wicket team!
>>
>> Now on to my question: If I look at the LocaleFirstMapper [1] in
>> wicket-examples, I see that in #getCompatibilityScore() it forwards the call
>> to the chain.
>> For as far as I can see this would not work, since most mappers (if not all)
>> have their own getCompatibilityScore() based on the amount of matching
>> segments from the start of the url.
>>
>> So in other words: by not stripping the locale from the request url before
>> forwarding the call to the chain, will this not result in a 0 score for all
>> mappers?
>>
>> Sebastian
>>
>> [1]
>> http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5-M3/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java/?v=source
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

Re: LocaleFirstMapper in wicket 1.5

Posted by Bas Gooren <ba...@iswd.nl>.
Ok, done: https://issues.apache.org/jira/browse/WICKET-4055

Sebastian

Op 14-9-2011 21:32, schreef Igor Vaynberg:
> yes, good catch Bas. please open a jira ticket.
>
> -igor
>
> On Wed, Sep 14, 2011 at 12:12 PM, Bas Gooren<ba...@iswd.nl>  wrote:
>> Hi all,
>>
>> I'm in the process of migrating our internal code library to 1.5.
>> So far the main feeling is: wow, most things became a lot easier and
>> cleaner.
>> In other words: thanks wicket team!
>>
>> Now on to my question: If I look at the LocaleFirstMapper [1] in
>> wicket-examples, I see that in #getCompatibilityScore() it forwards the call
>> to the chain.
>> For as far as I can see this would not work, since most mappers (if not all)
>> have their own getCompatibilityScore() based on the amount of matching
>> segments from the start of the url.
>>
>> So in other words: by not stripping the locale from the request url before
>> forwarding the call to the chain, will this not result in a 0 score for all
>> mappers?
>>
>> Sebastian
>>
>> [1]
>> http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5-M3/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java/?v=source
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

Re: LocaleFirstMapper in wicket 1.5

Posted by Igor Vaynberg <ig...@gmail.com>.
yes, good catch Bas. please open a jira ticket.

-igor

On Wed, Sep 14, 2011 at 12:12 PM, Bas Gooren <ba...@iswd.nl> wrote:
> Hi all,
>
> I'm in the process of migrating our internal code library to 1.5.
> So far the main feeling is: wow, most things became a lot easier and
> cleaner.
> In other words: thanks wicket team!
>
> Now on to my question: If I look at the LocaleFirstMapper [1] in
> wicket-examples, I see that in #getCompatibilityScore() it forwards the call
> to the chain.
> For as far as I can see this would not work, since most mappers (if not all)
> have their own getCompatibilityScore() based on the amount of matching
> segments from the start of the url.
>
> So in other words: by not stripping the locale from the request url before
> forwarding the call to the chain, will this not result in a 0 score for all
> mappers?
>
> Sebastian
>
> [1]
> http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5-M3/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java/?v=source
>

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