i wonder if this isn't common enough to provide a more turnkey solution as well.
what if we provided a page mapping facility like struts where an XML file contains
mappings from URLs to pages? this could then be implemented in terms of your
facility. it has been a goal to stay away from XML files, but this is one place where
it might be worth having an XML file. maybe something like:
<BookmarkablePageMappings>
<BookmarkablePageMapping from = "/mypage.html" to = "myapp.MyPage"/>
<BookmarkablePageMapping from = "/flashlights.html" to = "myapp.Products?item=flashlight"/>
</BookmarkablePageMappings>
in this scenario, every URL is mapped to a "appname?bookmarkable=..." destination.
just an idea....
jon
Juergen Donnerstag wrote:
Whenever I show Wicket to a friend, one the first thngs they ask me: why can't I use urls like http//localhost/myapp/mypage.html. Why do I need /myapp?bookmarkable=myapp.MyPage?
I must admit I understand there request, especially as I don't know any good reason not to have it. Until now I used urlrewriter - a java servlet filter based Url rewriter - but it is lacking one important feature. I want *.html urls be case insensitive but I do not want one rule for each html url. Thus I need to be able to map (key: url.toLower()) with the case sensitive "class name".
Besides there is another, security aspect. Currently all classes provided with bookmarkable=... get loaded as long as it is a Page. Most applications will have BasePages to provide authenication, apply corporate layout etc.. But currently you can not prevent the user from calling this pages (urls) directly. Hmm, I guess that is wrong; simply make the class abstract. Nevertheless
my idea is simple. Extend HttpRequestCycle.handleRender() to call an empty setPageFromUrl() like if (setPageFromUrl() || callComponentListener() || bookmarkablePage() || homePage()) with an empty implementation like protected boolean setPageFromUrl() { return false; }
Subclasses of HttpRequestCycle may now implement there own logic to determine the Page from the URL.
Finally make HttpApplication.doGet() non final to allow MyApplication to subclass doGet() and to replace cycle = new HttpRequestCycle() with my extended version.
Any thughts?
Juergen
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
Wicket-develop mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
Wicket-develop mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
