You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alex Rass <ar...@itbsllc.com> on 2009/10/05 23:12:13 UTC

how to map 2 html files to 1 class?

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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: how to map 2 html files to 1 class?

Posted by Alex Rass <ar...@itbsllc.com>.
Scott,

Maybe I am not clear on how localization works, but what you are proposing
would work only if I needed ONE of the html files to be available at one
time/session to same user.

What I want is:

3 html files. Called up via 3 distinct predefined urls. All handled by 1
class.

As far as I can tell from reading a ton of code today: anything beyond the
Page class has no idea as to what URL was called up by the user, just the
class. And from that class, it finds variations of url name based on class's
name.

I have a many:one mapping. Many html files to one class.
No way to find out from class - which URL was requested.

Page class knows the url through the getRequest. No one further has any
idea.

Again, that's just what I read. Which is why I am here....


-----Original Message-----
From: Scott Swank [mailto:scott.swank@gmail.com] 
Sent: Monday, October 05, 2009 5:56 PM
To: users@wicket.apache.org
Subject: Re: how to map 2 html files to 1 class?

But if all three html files are associated with the same Java class,
how does this differ from separate skins?  Is the distinction
semantic, or am I missing something?

Scott

On Mon, Oct 5, 2009 at 2:44 PM, Alex Rass <ar...@itbsllc.com> wrote:
> 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.swank@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 <ar...@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.makundi@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 <ma...@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 <ma...@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 <ar...@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-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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



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


Re: how to map 2 html files to 1 class?

Posted by Scott Swank <sc...@gmail.com>.
But if all three html files are associated with the same Java class,
how does this differ from separate skins?  Is the distinction
semantic, or am I missing something?

Scott

On Mon, Oct 5, 2009 at 2:44 PM, Alex Rass <ar...@itbsllc.com> wrote:
> 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.swank@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 <ar...@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.makundi@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 <ma...@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 <ma...@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 <ar...@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-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


RE: how to map 2 html files to 1 class?

Posted by Alex Rass <ar...@itbsllc.com>.
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.swank@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 <ar...@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.makundi@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 <ma...@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 <ma...@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 <ar...@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-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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



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


Re: how to map 2 html files to 1 class?

Posted by Scott Swank <sc...@gmail.com>.
Have you considered using variant or style?

http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications.html

Scott

On Mon, Oct 5, 2009 at 2:35 PM, Alex Rass <ar...@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.makundi@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 <ma...@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 <ma...@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 <ar...@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-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: how to map 2 html files to 1 class?

Posted by vinitty <vi...@gmail.com>.
Guys, 
You can always create dynamic class 

Use java assist 

I was also having same problem and i use that and it works fine




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-map-2-html-files-to-1-class-tp1890619p4651138.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: how to map 2 html files to 1 class?

Posted by Scott Swank <sc...@gmail.com>.
I don't see a Component#setVariation() method, but then we're still on 1.3.5.

On Mon, Oct 5, 2009 at 4:06 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> Yes - this sounds like a good idea.  I believe you could also call
> setVariation(parameters.get(0 or "type", etc)) in your constructor and use
> the parameter to determine which HTML file is rendered.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Mon, Oct 5, 2009 at 5:44 PM, Phil Housley <un...@gmail.com>wrote:
>
>> 2009/10/5 Alex Rass <ar...@itbsllc.com>:
>> > Standardizing footers across the site.
>> > So I will have a dozen pages which are bare content + footer from a
>> common
>> > file/db.
>> > I don't want to have THAT many useless classes.  If I do - wicket is a
>> > failure.
>>
>> It sounds as though you don't actually want to use any Wicket features
>> for the content of any of these pages, so I don't think you actually
>> want to create pages for them at all.
>>
>> Instead, I would have a general "content" page, and then interpret the
>> rest of the URL as an argument.  I can't remember which type of mount
>> you need, but you would basically interpret something like:
>>
>> /content/home
>> /content/index
>> /content/something
>>
>> as all being the same page, with a single parameter.  Then in the page
>> class you just print out some raw HTML content for the entire middle
>> bit of the page.  There are various ways to do that, and you have a
>> free choice if really all you want to do is write straight to the
>> response.
>>
>> > -----Original Message-----
>> > From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
>> > Sent: Monday, October 05, 2009 6:27 PM
>> > To: users@wicket.apache.org
>> > Subject: Re: how to map 2 html files to 1 class?
>> >
>> > What are you handling there ?
>> >
>> > **
>> > Martin
>> >
>> > 2009/10/6 Alex Rass <ar...@itbsllc.com>:
>> >> PageA.html <> PageB.html <> PageC.html
>> >>
>> >> Think about it this way:
>> >> PageA.html  = Privacy Page
>> >> PageB.html = SiteMap Page.
>> >>
>> >> I want to "handle" them both in same java class file cause hardly
>> anything
>> >> is going on there.
>> >>
>> >>
>> >> -----Original Message-----
>> >> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
>> >> Sent: Monday, October 05, 2009 6:08 PM
>> >> To: users@wicket.apache.org
>> >> Subject: Re: how to map 2 html files to 1 class?
>> >>
>> >>> PageHandler.java, that handles all 3.
>> >>> mountBookmarkablePage("/PageA.html", PageHandler.class);
>> >>> mountBookmarkablePage("/PageB.html", PageHandler.class);
>> >>> mountBookmarkablePage("/PageC.html", PageHandler.class);
>> >>
>> >> This is a bit confusing, you ar giving different aliases to the same
>> >> page. Is that what you want or you really want different html files
>> >> also..`?
>> >>
>> >> **
>> >> Martin
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>>
>>
>> --
>> Phil Housley
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

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


Re: how to map 2 html files to 1 class?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Yes - this sounds like a good idea.  I believe you could also call
setVariation(parameters.get(0 or "type", etc)) in your constructor and use
the parameter to determine which HTML file is rendered.

--
Jeremy Thomerson
http://www.wickettraining.com



On Mon, Oct 5, 2009 at 5:44 PM, Phil Housley <un...@gmail.com>wrote:

> 2009/10/5 Alex Rass <ar...@itbsllc.com>:
> > Standardizing footers across the site.
> > So I will have a dozen pages which are bare content + footer from a
> common
> > file/db.
> > I don't want to have THAT many useless classes.  If I do - wicket is a
> > failure.
>
> It sounds as though you don't actually want to use any Wicket features
> for the content of any of these pages, so I don't think you actually
> want to create pages for them at all.
>
> Instead, I would have a general "content" page, and then interpret the
> rest of the URL as an argument.  I can't remember which type of mount
> you need, but you would basically interpret something like:
>
> /content/home
> /content/index
> /content/something
>
> as all being the same page, with a single parameter.  Then in the page
> class you just print out some raw HTML content for the entire middle
> bit of the page.  There are various ways to do that, and you have a
> free choice if really all you want to do is write straight to the
> response.
>
> > -----Original Message-----
> > From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> > Sent: Monday, October 05, 2009 6:27 PM
> > To: users@wicket.apache.org
> > Subject: Re: how to map 2 html files to 1 class?
> >
> > What are you handling there ?
> >
> > **
> > Martin
> >
> > 2009/10/6 Alex Rass <ar...@itbsllc.com>:
> >> PageA.html <> PageB.html <> PageC.html
> >>
> >> Think about it this way:
> >> PageA.html  = Privacy Page
> >> PageB.html = SiteMap Page.
> >>
> >> I want to "handle" them both in same java class file cause hardly
> anything
> >> is going on there.
> >>
> >>
> >> -----Original Message-----
> >> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> >> Sent: Monday, October 05, 2009 6:08 PM
> >> To: users@wicket.apache.org
> >> Subject: Re: how to map 2 html files to 1 class?
> >>
> >>> PageHandler.java, that handles all 3.
> >>> mountBookmarkablePage("/PageA.html", PageHandler.class);
> >>> mountBookmarkablePage("/PageB.html", PageHandler.class);
> >>> mountBookmarkablePage("/PageC.html", PageHandler.class);
> >>
> >> This is a bit confusing, you ar giving different aliases to the same
> >> page. Is that what you want or you really want different html files
> >> also..`?
> >>
> >> **
> >> Martin
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
>
> --
> Phil Housley
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: how to map 2 html files to 1 class?

Posted by Phil Housley <un...@gmail.com>.
2009/10/5 Alex Rass <ar...@itbsllc.com>:
> Standardizing footers across the site.
> So I will have a dozen pages which are bare content + footer from a common
> file/db.
> I don't want to have THAT many useless classes.  If I do - wicket is a
> failure.

It sounds as though you don't actually want to use any Wicket features
for the content of any of these pages, so I don't think you actually
want to create pages for them at all.

Instead, I would have a general "content" page, and then interpret the
rest of the URL as an argument.  I can't remember which type of mount
you need, but you would basically interpret something like:

/content/home
/content/index
/content/something

as all being the same page, with a single parameter.  Then in the page
class you just print out some raw HTML content for the entire middle
bit of the page.  There are various ways to do that, and you have a
free choice if really all you want to do is write straight to the
response.

> -----Original Message-----
> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> Sent: Monday, October 05, 2009 6:27 PM
> To: users@wicket.apache.org
> Subject: Re: how to map 2 html files to 1 class?
>
> What are you handling there ?
>
> **
> Martin
>
> 2009/10/6 Alex Rass <ar...@itbsllc.com>:
>> PageA.html <> PageB.html <> PageC.html
>>
>> Think about it this way:
>> PageA.html  = Privacy Page
>> PageB.html = SiteMap Page.
>>
>> I want to "handle" them both in same java class file cause hardly anything
>> is going on there.
>>
>>
>> -----Original Message-----
>> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
>> Sent: Monday, October 05, 2009 6:08 PM
>> To: users@wicket.apache.org
>> Subject: Re: how to map 2 html files to 1 class?
>>
>>> PageHandler.java, that handles all 3.
>>> mountBookmarkablePage("/PageA.html", PageHandler.class);
>>> mountBookmarkablePage("/PageB.html", PageHandler.class);
>>> mountBookmarkablePage("/PageC.html", PageHandler.class);
>>
>> This is a bit confusing, you ar giving different aliases to the same
>> page. Is that what you want or you really want different html files
>> also..`?
>>
>> **
>> Martin
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Phil Housley

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


RE: how to map 2 html files to 1 class?

Posted by Alex Rass <ar...@itbsllc.com>.
Please read the posts in full.
GOAL: to not have 200 classes that do NOTHING but inherit from parent class
and are empty inside.

-----Original Message-----
From: Jeremy Thomerson [mailto:jeremy@wickettraining.com] 
Sent: Monday, October 05, 2009 6:38 PM
To: users@wicket.apache.org
Subject: Re: how to map 2 html files to 1 class?

Do you use page inheritance?  The header / footer / common navbars should go
in a common parent class.  Then your child classes have only the content
that is unique to that class.

--
Jeremy Thomerson
http://www.wickettraining.com



On Mon, Oct 5, 2009 at 5:36 PM, Alex Rass <ar...@itbsllc.com> wrote:

> Standardizing footers across the site.
> So I will have a dozen pages which are bare content + footer from a common
> file/db.
> I don't want to have THAT many useless classes.  If I do - wicket is a
> failure.
>
> -----Original Message-----
> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> Sent: Monday, October 05, 2009 6:27 PM
> To: users@wicket.apache.org
> Subject: Re: how to map 2 html files to 1 class?
>
> What are you handling there ?
>
> **
> Martin
>
> 2009/10/6 Alex Rass <ar...@itbsllc.com>:
> > PageA.html <> PageB.html <> PageC.html
> >
> > Think about it this way:
> > PageA.html  = Privacy Page
> > PageB.html = SiteMap Page.
> >
> > I want to "handle" them both in same java class file cause hardly
> anything
> > is going on there.
> >
> >
> > -----Original Message-----
> > From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> > Sent: Monday, October 05, 2009 6:08 PM
> > To: users@wicket.apache.org
> > Subject: Re: how to map 2 html files to 1 class?
> >
> >> PageHandler.java, that handles all 3.
> >> mountBookmarkablePage("/PageA.html", PageHandler.class);
> >> mountBookmarkablePage("/PageB.html", PageHandler.class);
> >> mountBookmarkablePage("/PageC.html", PageHandler.class);
> >
> > This is a bit confusing, you ar giving different aliases to the same
> > page. Is that what you want or you really want different html files
> > also..`?
> >
> > **
> > Martin
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


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


Re: how to map 2 html files to 1 class?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Do you use page inheritance?  The header / footer / common navbars should go
in a common parent class.  Then your child classes have only the content
that is unique to that class.

--
Jeremy Thomerson
http://www.wickettraining.com



On Mon, Oct 5, 2009 at 5:36 PM, Alex Rass <ar...@itbsllc.com> wrote:

> Standardizing footers across the site.
> So I will have a dozen pages which are bare content + footer from a common
> file/db.
> I don't want to have THAT many useless classes.  If I do - wicket is a
> failure.
>
> -----Original Message-----
> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> Sent: Monday, October 05, 2009 6:27 PM
> To: users@wicket.apache.org
> Subject: Re: how to map 2 html files to 1 class?
>
> What are you handling there ?
>
> **
> Martin
>
> 2009/10/6 Alex Rass <ar...@itbsllc.com>:
> > PageA.html <> PageB.html <> PageC.html
> >
> > Think about it this way:
> > PageA.html  = Privacy Page
> > PageB.html = SiteMap Page.
> >
> > I want to "handle" them both in same java class file cause hardly
> anything
> > is going on there.
> >
> >
> > -----Original Message-----
> > From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> > Sent: Monday, October 05, 2009 6:08 PM
> > To: users@wicket.apache.org
> > Subject: Re: how to map 2 html files to 1 class?
> >
> >> PageHandler.java, that handles all 3.
> >> mountBookmarkablePage("/PageA.html", PageHandler.class);
> >> mountBookmarkablePage("/PageB.html", PageHandler.class);
> >> mountBookmarkablePage("/PageC.html", PageHandler.class);
> >
> > This is a bit confusing, you ar giving different aliases to the same
> > page. Is that what you want or you really want different html files
> > also..`?
> >
> > **
> > Martin
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: how to map 2 html files to 1 class?

Posted by Scott Swank <sc...@gmail.com>.
Alternately, I'm unsure why variation wouldn't work for you, something like:

public EmptyPage(String pageVariation)
{
  this.pageVariation = pageVariation;
}

@Override
public String getVariation()
{
  return pageVariation;
}

Then you could have html classes such as:

BasePage_home.html
BasePage_index.html
BasePage_something.html

>From there you could look at MixedParamUrlCodingStrategy to set up urls such as

www.domain.com/some/path/home
www.domain.com/some/path/index
www.domain.com/some/path/something

Scott


On Mon, Oct 5, 2009 at 3:50 PM, Martin Makundi
<ma...@koodaripalvelut.com> wrote:
>> But yes, at least you should be able to take the html file name as
>> parameter to a bookmarkable page somehow and work from there?
>>
>> www.domain.com/PageHandler/intro.html/show
>> or
>> www.domain.com/PageHandler/show/intro.html
>
> And then override this:
>
>        public MarkupStream getAssociatedMarkupStream(final boolean throwException)
>        {
>                try
>                {
>                        return getApplication().getMarkupSettings().getMarkupCache().getMarkupStream(this,
>                                false, throwException);
>                }
>
> or something there inside...?
>
>
> **
> Martin
>>
>> **
>> Martin
>>
>> 2009/10/6 Alex Rass <ar...@itbsllc.com>:
>>> Standardizing footers across the site.
>>> So I will have a dozen pages which are bare content + footer from a common
>>> file/db.
>>> I don't want to have THAT many useless classes.  If I do - wicket is a
>>> failure.
>>>
>>> -----Original Message-----
>>> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
>>> Sent: Monday, October 05, 2009 6:27 PM
>>> To: users@wicket.apache.org
>>> Subject: Re: how to map 2 html files to 1 class?
>>>
>>> What are you handling there ?
>>>
>>> **
>>> Martin
>>>
>>> 2009/10/6 Alex Rass <ar...@itbsllc.com>:
>>>> PageA.html <> PageB.html <> PageC.html
>>>>
>>>> Think about it this way:
>>>> PageA.html  = Privacy Page
>>>> PageB.html = SiteMap Page.
>>>>
>>>> I want to "handle" them both in same java class file cause hardly anything
>>>> is going on there.
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
>>>> Sent: Monday, October 05, 2009 6:08 PM
>>>> To: users@wicket.apache.org
>>>> Subject: Re: how to map 2 html files to 1 class?
>>>>
>>>>> PageHandler.java, that handles all 3.
>>>>> mountBookmarkablePage("/PageA.html", PageHandler.class);
>>>>> mountBookmarkablePage("/PageB.html", PageHandler.class);
>>>>> mountBookmarkablePage("/PageC.html", PageHandler.class);
>>>>
>>>> This is a bit confusing, you ar giving different aliases to the same
>>>> page. Is that what you want or you really want different html files
>>>> also..`?
>>>>
>>>> **
>>>> Martin
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: how to map 2 html files to 1 class?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
> But yes, at least you should be able to take the html file name as
> parameter to a bookmarkable page somehow and work from there?
>
> www.domain.com/PageHandler/intro.html/show
> or
> www.domain.com/PageHandler/show/intro.html

And then override this:

	public MarkupStream getAssociatedMarkupStream(final boolean throwException)
	{
		try
		{
			return getApplication().getMarkupSettings().getMarkupCache().getMarkupStream(this,
				false, throwException);
		}

or something there inside...?


**
Martin
>
> **
> Martin
>
> 2009/10/6 Alex Rass <ar...@itbsllc.com>:
>> Standardizing footers across the site.
>> So I will have a dozen pages which are bare content + footer from a common
>> file/db.
>> I don't want to have THAT many useless classes.  If I do - wicket is a
>> failure.
>>
>> -----Original Message-----
>> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
>> Sent: Monday, October 05, 2009 6:27 PM
>> To: users@wicket.apache.org
>> Subject: Re: how to map 2 html files to 1 class?
>>
>> What are you handling there ?
>>
>> **
>> Martin
>>
>> 2009/10/6 Alex Rass <ar...@itbsllc.com>:
>>> PageA.html <> PageB.html <> PageC.html
>>>
>>> Think about it this way:
>>> PageA.html  = Privacy Page
>>> PageB.html = SiteMap Page.
>>>
>>> I want to "handle" them both in same java class file cause hardly anything
>>> is going on there.
>>>
>>>
>>> -----Original Message-----
>>> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
>>> Sent: Monday, October 05, 2009 6:08 PM
>>> To: users@wicket.apache.org
>>> Subject: Re: how to map 2 html files to 1 class?
>>>
>>>> PageHandler.java, that handles all 3.
>>>> mountBookmarkablePage("/PageA.html", PageHandler.class);
>>>> mountBookmarkablePage("/PageB.html", PageHandler.class);
>>>> mountBookmarkablePage("/PageC.html", PageHandler.class);
>>>
>>> This is a bit confusing, you ar giving different aliases to the same
>>> page. Is that what you want or you really want different html files
>>> also..`?
>>>
>>> **
>>> Martin
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

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


Re: how to map 2 html files to 1 class?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Maybe you're doing the wrong thing with wicket.. it's not for serving
static content.

But yes, at least you should be able to take the html file name as
parameter to a bookmarkable page somehow and work from there?

www.domain.com/PageHandler/intro.html/show
or
www.domain.com/PageHandler/show/intro.html

?

**
Martin

2009/10/6 Alex Rass <ar...@itbsllc.com>:
> Standardizing footers across the site.
> So I will have a dozen pages which are bare content + footer from a common
> file/db.
> I don't want to have THAT many useless classes.  If I do - wicket is a
> failure.
>
> -----Original Message-----
> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> Sent: Monday, October 05, 2009 6:27 PM
> To: users@wicket.apache.org
> Subject: Re: how to map 2 html files to 1 class?
>
> What are you handling there ?
>
> **
> Martin
>
> 2009/10/6 Alex Rass <ar...@itbsllc.com>:
>> PageA.html <> PageB.html <> PageC.html
>>
>> Think about it this way:
>> PageA.html  = Privacy Page
>> PageB.html = SiteMap Page.
>>
>> I want to "handle" them both in same java class file cause hardly anything
>> is going on there.
>>
>>
>> -----Original Message-----
>> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
>> Sent: Monday, October 05, 2009 6:08 PM
>> To: users@wicket.apache.org
>> Subject: Re: how to map 2 html files to 1 class?
>>
>>> PageHandler.java, that handles all 3.
>>> mountBookmarkablePage("/PageA.html", PageHandler.class);
>>> mountBookmarkablePage("/PageB.html", PageHandler.class);
>>> mountBookmarkablePage("/PageC.html", PageHandler.class);
>>
>> This is a bit confusing, you ar giving different aliases to the same
>> page. Is that what you want or you really want different html files
>> also..`?
>>
>> **
>> Martin
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


RE: how to map 2 html files to 1 class?

Posted by Alex Rass <ar...@itbsllc.com>.
Standardizing footers across the site.
So I will have a dozen pages which are bare content + footer from a common
file/db.
I don't want to have THAT many useless classes.  If I do - wicket is a
failure.

-----Original Message-----
From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com] 
Sent: Monday, October 05, 2009 6:27 PM
To: users@wicket.apache.org
Subject: Re: how to map 2 html files to 1 class?

What are you handling there ?

**
Martin

2009/10/6 Alex Rass <ar...@itbsllc.com>:
> PageA.html <> PageB.html <> PageC.html
>
> Think about it this way:
> PageA.html  = Privacy Page
> PageB.html = SiteMap Page.
>
> I want to "handle" them both in same java class file cause hardly anything
> is going on there.
>
>
> -----Original Message-----
> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> Sent: Monday, October 05, 2009 6:08 PM
> To: users@wicket.apache.org
> Subject: Re: how to map 2 html files to 1 class?
>
>> PageHandler.java, that handles all 3.
>> mountBookmarkablePage("/PageA.html", PageHandler.class);
>> mountBookmarkablePage("/PageB.html", PageHandler.class);
>> mountBookmarkablePage("/PageC.html", PageHandler.class);
>
> This is a bit confusing, you ar giving different aliases to the same
> page. Is that what you want or you really want different html files
> also..`?
>
> **
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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



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


Re: how to map 2 html files to 1 class?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
What are you handling there ?

**
Martin

2009/10/6 Alex Rass <ar...@itbsllc.com>:
> PageA.html <> PageB.html <> PageC.html
>
> Think about it this way:
> PageA.html  = Privacy Page
> PageB.html = SiteMap Page.
>
> I want to "handle" them both in same java class file cause hardly anything
> is going on there.
>
>
> -----Original Message-----
> From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> Sent: Monday, October 05, 2009 6:08 PM
> To: users@wicket.apache.org
> Subject: Re: how to map 2 html files to 1 class?
>
>> PageHandler.java, that handles all 3.
>> mountBookmarkablePage("/PageA.html", PageHandler.class);
>> mountBookmarkablePage("/PageB.html", PageHandler.class);
>> mountBookmarkablePage("/PageC.html", PageHandler.class);
>
> This is a bit confusing, you ar giving different aliases to the same
> page. Is that what you want or you really want different html files
> also..`?
>
> **
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


RE: how to map 2 html files to 1 class?

Posted by Alex Rass <ar...@itbsllc.com>.
PageA.html <> PageB.html <> PageC.html

Think about it this way:
PageA.html  = Privacy Page 
PageB.html = SiteMap Page.

I want to "handle" them both in same java class file cause hardly anything
is going on there.


-----Original Message-----
From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com] 
Sent: Monday, October 05, 2009 6:08 PM
To: users@wicket.apache.org
Subject: Re: how to map 2 html files to 1 class?

> PageHandler.java, that handles all 3.
> mountBookmarkablePage("/PageA.html", PageHandler.class);
> mountBookmarkablePage("/PageB.html", PageHandler.class);
> mountBookmarkablePage("/PageC.html", PageHandler.class);

This is a bit confusing, you ar giving different aliases to the same
page. Is that what you want or you really want different html files
also..`?

**
Martin

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



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


Re: how to map 2 html files to 1 class?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
> PageHandler.java, that handles all 3.
> mountBookmarkablePage("/PageA.html", PageHandler.class);
> mountBookmarkablePage("/PageB.html", PageHandler.class);
> mountBookmarkablePage("/PageC.html", PageHandler.class);

This is a bit confusing, you ar giving different aliases to the same
page. Is that what you want or you really want different html files
also..`?

**
Martin

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


RE: how to map 2 html files to 1 class?

Posted by Alex Rass <ar...@itbsllc.com>.
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.makundi@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 <ma...@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 <ma...@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 <ar...@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-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>

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



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


Re: how to map 2 html files to 1 class?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
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 <ma...@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 <ma...@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 <ar...@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-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>

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


Re: how to map 2 html files to 1 class?

Posted by Martin Makundi <ma...@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 <ma...@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 <ar...@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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

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


Re: how to map 2 html files to 1 class?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Meant to say

if (A-mode) {
new PageVersionAContantHandler(this);
} else {
new PageVersionBContantHandler(this); // B ofcourse
}

**
Martin

2009/10/6 Martin Makundi <ma...@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 <ar...@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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

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


Re: how to map 2 html files to 1 class?

Posted by Martin Makundi <ma...@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 <ar...@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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