You are right!
I've reopened the ticket and attached your patch there.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Sep 22, 2014 at 3:53 PM, Jesse Long <[email protected]> wrote:

> Hi Martin,
>
> Sorry, but I dont think that fix will work. The problem is when compound
> -> wrapper -> compound -> mount, that fix only does compound -> compound ->
> mount.
>
> I have coded up a solution, but I have not done tests yet.
> I have attached the patch. Sorry, I still plan to do proper tests for this.
>
> Thanks,
> Jesse
>
>
> On 22/09/2014 10:40, Martin Grigorov wrote:
>
>> Fixed.
>> The fix was much simpler !
>> See https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=
>> commit;h=f45ce896
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Wed, Sep 10, 2014 at 3:11 PM, Martin Grigorov <[email protected]>
>> wrote:
>>
>>  https://issues.apache.org/jira/browse/WICKET-5698
>>>
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>>
>>> On Wed, Sep 10, 2014 at 3:08 PM, Martin Grigorov <[email protected]>
>>> wrote:
>>>
>>>  Hi Jesse,
>>>>
>>>> Do you work on this ?
>>>> I can take care of it if you don't have time.
>>>>
>>>> Martin Grigorov
>>>> Wicket Training and Consulting
>>>> https://twitter.com/mtgrigorov
>>>>
>>>> On Thu, Sep 4, 2014 at 3:00 PM, Martin Grigorov <[email protected]>
>>>> wrote:
>>>>
>>>>  Hi Jesse,
>>>>>
>>>>> To me 1) looks the simplest and the most flexible one.
>>>>>
>>>>> Martin Grigorov
>>>>> Wicket Training and Consulting
>>>>> https://twitter.com/mtgrigorov
>>>>>
>>>>>
>>>>> On Thu, Sep 4, 2014 at 1:12 PM, Jesse Long <[email protected]> wrote:
>>>>>
>>>>>  Hi Wicket Devs,
>>>>>>
>>>>>> WebApplication.unmount() and/or CompoundRequestMapper.unmount() is
>>>>>> broken, and I want to fix it.
>>>>>>
>>>>>> WebApplication.unmount() calls getRootRequestMapperAsCompound(), and
>>>>>> calls unmount() on that.
>>>>>>
>>>>>> getRootRequestMapperAsCompound() checks if the root request mapper is
>>>>>> a compound, if not, wraps it in a compound, sets the compound as root
>>>>>> and
>>>>>> returns the compound.
>>>>>>
>>>>>> CompoundRequestMapper.unmount() identifies which of the mappers added
>>>>>> directly to the compound handle the url, and removes them.
>>>>>>
>>>>>> The problem:
>>>>>> If the original root mapper was a single wrapper, or layer of
>>>>>> wrappers,
>>>>>> with the actual mounted mapper wrapped some levels down, then the
>>>>>> whole
>>>>>> wrapper is removed, not just the specific MountedMapper that is
>>>>>> wrapped.
>>>>>> This has the effect of removing every single mapper, leaving root
>>>>>> mapper as
>>>>>> an empty compound.
>>>>>>
>>>>>> I would like to attempt to provide a patch to fix this, but would like
>>>>>> guidance on the approach. I have come up with three approaches:
>>>>>>
>>>>>> 1. Introduce interface IWrappedRequestMapper. This will be an
>>>>>> interface
>>>>>> which has one method: IRequestMapper getWrappedRequestMapper(). We
>>>>>> can then
>>>>>> have all wrapper mappers implement this and work down the tree to
>>>>>> find the
>>>>>> correct MountedMapper (wicket 6) to remove.
>>>>>>
>>>>>> 2. Have WebApplication hold a reference to a specific
>>>>>> CompoundRequestMapper, and have all mount()/unmount() operations add
>>>>>> and
>>>>>> remove from this mapper. This compound would need to be added to the
>>>>>> default list during init. This makes it complicated to work out how
>>>>>> to do
>>>>>> things like have CryptoMapper not apply to mounted pages.
>>>>>>
>>>>>> 3. Add method unmount() to IRequestMapper, so that wrappers can
>>>>>> delegate. This obviously can only be done in wicket 7, but we're
>>>>>> making
>>>>>> mounting a problem of every single request mapper, when not even
>>>>>> Application cares about mounting.
>>>>>>
>>>>>> Any thoughts?
>>>>>>
>>>>>> Thanks,
>>>>>> Jesse
>>>>>>
>>>>>>
>>>>>
>

Reply via email to