You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2010/10/21 16:07:16 UTC

[jira] Created: (WICKET-3126) Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)

Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)
-----------------------------------------------------------------

                 Key: WICKET-3126
                 URL: https://issues.apache.org/jira/browse/WICKET-3126
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 1.5-M2.1
            Reporter: Martin Grigorov


Currently requests to '/' are handled by HomePageMapper when the request comes and by BookmarkableMapper when an Url should be created (e.g. for links, forms, redirects, etc.). So requesting '/' ends with URL in the browser address bar like : "/wicket/bookmarkable/com.example.MyPage" (generated by BookmarkableMapper).
The final Url is a bit confusing to users.

Here is suggestion for improvement:
drop HomePageMapper and use MountedMapper("/", app.getHomePage()) instead. This mapper will be registered after SystemMapper so it will be asked before all pre-configured mappers. if the user application still wants to map something else than Application#getHomePage() at "/" then it can do : add(new MountedMapper("/", CustomPage.class).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (WICKET-3126) Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)

Posted by mcgregory <mc...@e-card.bg>.
----- Original message -----
> 
>         [
> https://issues.apache.org/jira/browse/WICKET-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923492#action_12923492
> ] 
> 
> Martin Grigorov commented on WICKET-3126:
> -----------------------------------------
> 
> "what if app.gethomepage() returns different values based on user's
> session?"
> 
> This is not covered in my patch...
Currently, MountedMapper keeps a WeakReference to the page class. If change this to use IProvider instead then i think this will work too.
> 
> 
> > Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)
> > -----------------------------------------------------------------
> > 
> > Key: WICKET-3126
> > URL: https://issues.apache.org/jira/browse/WICKET-3126
> > Project: Wicket
> > Issue Type: Improvement
> > Components: wicket
> > Affects Versions: 1.5-M2.1
> > Reporter: Martin Grigorov
> > Assignee: Martin Grigorov
> > Attachments: WICKET-3126.patch, WICKET-3126.patch, WICKET-3126.patch
> > 
> > 
> > Currently requests to '/' are handled by HomePageMapper when the
> > request comes and by BookmarkableMapper when an Url should be created
> > (e.g. for links, forms, redirects, etc.). So requesting '/' ends with
> > URL in the browser address bar like :
> > "/wicket/bookmarkable/com.example.MyPage" (generated by
> > BookmarkableMapper). The final Url is a bit confusing to users. Here
> > is suggestion for improvement: drop HomePageMapper and use
> > MountedMapper("/", app.getHomePage()) instead. This mapper will be
> > registered after SystemMapper so it will be asked before all
> > pre-configured mappers. if the user application still wants to map
> > something else than Application#getHomePage() at "/" then it can do :
> > add(new MountedMapper("/", CustomPage.class).
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> 


[jira] Commented: (WICKET-3126) Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923489#action_12923489 ] 

Igor Vaynberg commented on WICKET-3126:
---------------------------------------

what if app.gethomepage() returns different values based on user's session?

also the fact that we have to register it *after* is bothersome. perhaps we should bump all default compatibilities to -1 from 0. that way things that match just / can return 0 and still have priority.

> Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)
> -----------------------------------------------------------------
>
>                 Key: WICKET-3126
>                 URL: https://issues.apache.org/jira/browse/WICKET-3126
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-M2.1
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>         Attachments: WICKET-3126.patch, WICKET-3126.patch, WICKET-3126.patch
>
>
> Currently requests to '/' are handled by HomePageMapper when the request comes and by BookmarkableMapper when an Url should be created (e.g. for links, forms, redirects, etc.). So requesting '/' ends with URL in the browser address bar like : "/wicket/bookmarkable/com.example.MyPage" (generated by BookmarkableMapper).
> The final Url is a bit confusing to users.
> Here is suggestion for improvement:
> drop HomePageMapper and use MountedMapper("/", app.getHomePage()) instead. This mapper will be registered after SystemMapper so it will be asked before all pre-configured mappers. if the user application still wants to map something else than Application#getHomePage() at "/" then it can do : add(new MountedMapper("/", CustomPage.class).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-3126) Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923492#action_12923492 ] 

Martin Grigorov commented on WICKET-3126:
-----------------------------------------

"what if app.gethomepage() returns different values based on user's session?"

This is not covered in my patch...


> Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)
> -----------------------------------------------------------------
>
>                 Key: WICKET-3126
>                 URL: https://issues.apache.org/jira/browse/WICKET-3126
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-M2.1
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>         Attachments: WICKET-3126.patch, WICKET-3126.patch, WICKET-3126.patch
>
>
> Currently requests to '/' are handled by HomePageMapper when the request comes and by BookmarkableMapper when an Url should be created (e.g. for links, forms, redirects, etc.). So requesting '/' ends with URL in the browser address bar like : "/wicket/bookmarkable/com.example.MyPage" (generated by BookmarkableMapper).
> The final Url is a bit confusing to users.
> Here is suggestion for improvement:
> drop HomePageMapper and use MountedMapper("/", app.getHomePage()) instead. This mapper will be registered after SystemMapper so it will be asked before all pre-configured mappers. if the user application still wants to map something else than Application#getHomePage() at "/" then it can do : add(new MountedMapper("/", CustomPage.class).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-3126) Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923490#action_12923490 ] 

Martin Grigorov commented on WICKET-3126:
-----------------------------------------

With the latest version of the patch it is not needed to be added after BookmarkableMapper/ResourceReferenceMapper. Move the registration of HomePageMapper up/down in SystemMapper and it will work.

I'm wondering about adding the possibility to pass the compatibilityScore as ctor parameter, so the user is not needed to extend some Mapper just to change its compatibility score. But then funny things can happen. E.g. now MountedMapper calculates its compat score depending on the segments number, so mapper mounted at /a/b/c will take precedence over one on /a/b.

> Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)
> -----------------------------------------------------------------
>
>                 Key: WICKET-3126
>                 URL: https://issues.apache.org/jira/browse/WICKET-3126
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-M2.1
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>         Attachments: WICKET-3126.patch, WICKET-3126.patch, WICKET-3126.patch
>
>
> Currently requests to '/' are handled by HomePageMapper when the request comes and by BookmarkableMapper when an Url should be created (e.g. for links, forms, redirects, etc.). So requesting '/' ends with URL in the browser address bar like : "/wicket/bookmarkable/com.example.MyPage" (generated by BookmarkableMapper).
> The final Url is a bit confusing to users.
> Here is suggestion for improvement:
> drop HomePageMapper and use MountedMapper("/", app.getHomePage()) instead. This mapper will be registered after SystemMapper so it will be asked before all pre-configured mappers. if the user application still wants to map something else than Application#getHomePage() at "/" then it can do : add(new MountedMapper("/", CustomPage.class).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-3126) Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov updated WICKET-3126:
------------------------------------

    Attachment: WICKET-3126-provider.patch

A patch that uses IProvider (ClassProvider) to provide the home page class.
As a result now MountedMapper also uses ClassProvider.

> Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)
> -----------------------------------------------------------------
>
>                 Key: WICKET-3126
>                 URL: https://issues.apache.org/jira/browse/WICKET-3126
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-M2.1
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>         Attachments: WICKET-3126-provider.patch, WICKET-3126.patch, WICKET-3126.patch, WICKET-3126.patch
>
>
> Currently requests to '/' are handled by HomePageMapper when the request comes and by BookmarkableMapper when an Url should be created (e.g. for links, forms, redirects, etc.). So requesting '/' ends with URL in the browser address bar like : "/wicket/bookmarkable/com.example.MyPage" (generated by BookmarkableMapper).
> The final Url is a bit confusing to users.
> Here is suggestion for improvement:
> drop HomePageMapper and use MountedMapper("/", app.getHomePage()) instead. This mapper will be registered after SystemMapper so it will be asked before all pre-configured mappers. if the user application still wants to map something else than Application#getHomePage() at "/" then it can do : add(new MountedMapper("/", CustomPage.class).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-3126) Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov updated WICKET-3126:
------------------------------------

    Attachment: WICKET-3126.patch

Second version of the patch that inserts the "home mapper" in the list before BookmarkableMapper so it is asked later.

> Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)
> -----------------------------------------------------------------
>
>                 Key: WICKET-3126
>                 URL: https://issues.apache.org/jira/browse/WICKET-3126
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-M2.1
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>         Attachments: WICKET-3126.patch, WICKET-3126.patch
>
>
> Currently requests to '/' are handled by HomePageMapper when the request comes and by BookmarkableMapper when an Url should be created (e.g. for links, forms, redirects, etc.). So requesting '/' ends with URL in the browser address bar like : "/wicket/bookmarkable/com.example.MyPage" (generated by BookmarkableMapper).
> The final Url is a bit confusing to users.
> Here is suggestion for improvement:
> drop HomePageMapper and use MountedMapper("/", app.getHomePage()) instead. This mapper will be registered after SystemMapper so it will be asked before all pre-configured mappers. if the user application still wants to map something else than Application#getHomePage() at "/" then it can do : add(new MountedMapper("/", CustomPage.class).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-3126) Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-3126:
---------------------------------------

    Assignee: Martin Grigorov

> Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)
> -----------------------------------------------------------------
>
>                 Key: WICKET-3126
>                 URL: https://issues.apache.org/jira/browse/WICKET-3126
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-M2.1
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>
> Currently requests to '/' are handled by HomePageMapper when the request comes and by BookmarkableMapper when an Url should be created (e.g. for links, forms, redirects, etc.). So requesting '/' ends with URL in the browser address bar like : "/wicket/bookmarkable/com.example.MyPage" (generated by BookmarkableMapper).
> The final Url is a bit confusing to users.
> Here is suggestion for improvement:
> drop HomePageMapper and use MountedMapper("/", app.getHomePage()) instead. This mapper will be registered after SystemMapper so it will be asked before all pre-configured mappers. if the user application still wants to map something else than Application#getHomePage() at "/" then it can do : add(new MountedMapper("/", CustomPage.class).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-3126) Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov updated WICKET-3126:
------------------------------------

    Attachment: WICKET-3126.patch

A patch with required changes + unit tests.
Due to a bug? in MountedMapper a lot of tests in wicket/ are failing with this patch. I'll investigate it.

> Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)
> -----------------------------------------------------------------
>
>                 Key: WICKET-3126
>                 URL: https://issues.apache.org/jira/browse/WICKET-3126
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-M2.1
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>         Attachments: WICKET-3126.patch
>
>
> Currently requests to '/' are handled by HomePageMapper when the request comes and by BookmarkableMapper when an Url should be created (e.g. for links, forms, redirects, etc.). So requesting '/' ends with URL in the browser address bar like : "/wicket/bookmarkable/com.example.MyPage" (generated by BookmarkableMapper).
> The final Url is a bit confusing to users.
> Here is suggestion for improvement:
> drop HomePageMapper and use MountedMapper("/", app.getHomePage()) instead. This mapper will be registered after SystemMapper so it will be asked before all pre-configured mappers. if the user application still wants to map something else than Application#getHomePage() at "/" then it can do : add(new MountedMapper("/", CustomPage.class).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-3126) Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov updated WICKET-3126:
------------------------------------

    Attachment: WICKET-3126.patch

Attach a patch that solves all problems.
Now HomePageMapper extends MountedMapper and has no any (known) problems.

> Drop HomePageMapper in favour of MountedMapper("/", MyPage.class)
> -----------------------------------------------------------------
>
>                 Key: WICKET-3126
>                 URL: https://issues.apache.org/jira/browse/WICKET-3126
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5-M2.1
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>         Attachments: WICKET-3126.patch, WICKET-3126.patch, WICKET-3126.patch
>
>
> Currently requests to '/' are handled by HomePageMapper when the request comes and by BookmarkableMapper when an Url should be created (e.g. for links, forms, redirects, etc.). So requesting '/' ends with URL in the browser address bar like : "/wicket/bookmarkable/com.example.MyPage" (generated by BookmarkableMapper).
> The final Url is a bit confusing to users.
> Here is suggestion for improvement:
> drop HomePageMapper and use MountedMapper("/", app.getHomePage()) instead. This mapper will be registered after SystemMapper so it will be asked before all pre-configured mappers. if the user application still wants to map something else than Application#getHomePage() at "/" then it can do : add(new MountedMapper("/", CustomPage.class).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.