I don't see how this applies. Please note that ResourceStreamLocator does not see the original url's path. And Page uses a cacheKey which is solely based on the class name.
Maybe you can elaborate, but all 3 html files are TOTALLY UNRELATED PAGES. It's not the same page 3 times for diff skins. All 3 need to be available at the same time. (Should have made it clear earlier). -----Original Message----- From: Scott Swank [mailto:scott.sw...@gmail.com] Sent: Monday, October 05, 2009 5:38 PM To: users@wicket.apache.org Subject: Re: how to map 2 html files to 1 class? Have you considered using variant or style? http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications.htm l Scott On Mon, Oct 5, 2009 at 2:35 PM, Alex Rass <a...@itbsllc.com> wrote: > Yeah, that's what I had before. (Many fake classes that do nothing but > extend default one). > But I have multiple sites. With lots of pages. I don't want to have 200 > classes that serve no purpose! (I already have 30 like that for my first > couple sites :) was hoping to stop this silly practice) (hold the jokes > about "there aren't many classes that can claim to have a purpose" :) ) > > This thing about PageContantHandler intrigues me as this is exactly what I > need, but I don't understand how this would work. Unless this is your way of > asking the question. If so, here's what I want: > > > domain.com/PageA.html > domain.com/PageB.html > domain.com/PageC.html > (all files are locally on my site, just to keep it clear.) > > PageHandler.java, that handles all 3. > mountBookmarkablePage("/PageA.html", PageHandler.class); > mountBookmarkablePage("/PageB.html", PageHandler.class); > mountBookmarkablePage("/PageC.html", PageHandler.class); > > > > > -----Original Message----- > From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] > Sent: Monday, October 05, 2009 5:23 PM > To: users@wicket.apache.org > Subject: Re: how to map 2 html files to 1 class? > > And ofcourse you could have polymorphism. > > AbstractPageWithDesiredCommonFunctionality.java with all your common logic, > > Page1Design extends AbstractPageWithDesiredCommonFunctionality > Page2Design extends AbstractPageWithDesiredCommonFunctionality > : > : > : > Page-n-Design extends AbstractPageWithDesiredCommonFunctionality > > And also the html would be > Page1Design.html > Page2Design.html > : > : > : > Page-n-Design.html > > > ** > Martin > > 2009/10/6 Martin Makundi <martin.maku...@koodaripalvelut.com>: >> It's too late :) Apparently you wanted just the opposite. >> >> Well.. you could have: >> >> PageA.html: >> PageB.html: >> PageC.html: >> >> Page?.java: >> public class CommonPage extends WebPage { >> public CommonPage() { >> new PageContantHandler(this); >> } >> } >> >> ** >> Martin >> >> 2009/10/6 Martin Makundi <martin.maku...@koodaripalvelut.com>: >>> Hi! >>> >>> I did not exactly understand what you are after, but you can always do >>> like this: >>> >>> CommonPage.html: >>> .... blabla ... >>> >>> CommonPage.java: >>> public class CommonPage extends WebPage { >>> public CommonPage() { >>> if (A-mode) { >>> new PageVersionAContantHandler(this); >>> } else { >>> new PageVersionAContantHandler(this); >>> } >>> } >>> } >>> >>> Maybe you wanted something different? >>> >>> ** >>> Martin >>> >>> 2009/10/6 Alex Rass <a...@itbsllc.com>: >>>> Hi. >>>> >>>> Spent hours now trying to figure out how to map 2 html files to 1 class. >>>> If someone knows the answer - please help. >>>> >>>> I need to map 10 similar html pages to same class (for same behavior). >>>> >>>> Doing this: >>>> webApplication.mountBookmarkablePage("/page1.html", pageClass); >>>> Gets wicket to associate set url with the class. >>>> But then when the ResourceStreamLocator is called, it's given >>>> A reference to class and a reference to the path. Where class is set >>>> correctly (pageClass). >>>> But the PATH is set wrong. It is what Wicket THINKS it should try >>>> "PageClass_en.html". (class name + locale + default extension) >>>> >>>> While *I* would like to load my own class. >>>> >>>> I was thinking about completely rewriting ResourceStreamLocator to know > my >>>> own paths, BUT it's not aware of what real page is being loaded (as the > path >>>> is set to "PageClass_en.html"). >>>> >>>> I could also break down and load my own stuff in beforeRender, but I was >>>> hoping there's a better way to handle this. >>>> >>>> Lastly, I could overwrite onRender() in my PageClass... >>>> >>>> Any advice would be much appreciated. >>>> >>>> - Alex. >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>> >>>> >>> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org