You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Korbinian Bachl <ko...@whiskyworld.de> on 2006/11/15 14:31:01 UTC

wicket2 / multi-mounts to class

Hi,
 
in wicket 1.x you can do following:
 
 mount("/de/", new IndexedParamUrlCodingStrategy("",Katalog.class));
 mount("/en/", new IndexedParamUrlCodingStrategy("",Katalog.class));
 
while in wicket 2.0 you only can do:
 
mount(new IndexedParamUrlCodingStrategy("/de",Katalog.class));
mount(new IndexedParamUrlCodingStrategy("/en",Katalog.class));
 
wich then means that you cant switch by the 0 - Param the path... meaning if
you enter /IndexA/Foo/Bar you cant have a link to /IndexB/Foo/Bar by just
using PageParams("0=Foo,1=Bar") (similar..)
 
(the /de and /en here is the language for example)
 
 
is there a way to do this? else i would make a Jira featurerequest as this
behaviour is vital for me... i need to be able to have at least N paths that
are mounted to a single class and can then be switched by the first request
param.
 
Best Regards
 
Korbinian
 
 

Re: wicket2 / multi-mounts to class

Posted by Igor Vaynberg <ig...@gmail.com>.
On 11/16/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
>
> > what a stupid thing to say considering it was probably johan
> > that wrote that
> > part of the code in the first place. you wont be making any
> > friends here
> > saying things like these.
>
> i replied to his statement - and if im on a black list cause i critizise
> him, so it be.


we dont have a black list. in my book you have lost proverbial "notch".

i dont know if he wrote that or did it as i never made him
> resonsible for that, the thing i dont like is this eternal "and will stay"
> -


he spent a lot of time trying to explain to you the reasons for this - you
just refuse to listen because this broken functionality worked in your very
particular usecase.

in the end there is nothing wrong with a committer telling you that the api
will stay the way it is. we are the ones working on it, so we make the
decisions. we try to be as accomodating as possible, but when n00b users ask
for what we think will do more harm then good we are free to say no.

of course you are free to fork wicket if you do not like how we run it.

> you used that api in a way it was not meant to be used. it is
> > "lucky" that
> > it worked for you because it was not our intention to make
> > your usecase
> > work. this why we stripped this functionality. btw, it was
> > stripped way
> > before you showed up or someone tried to do what you did.
>
> maybe it wasnt meant for this... the internet wasnt meant to be what its
> today, so should we strip it away?
> (yes, this was polemic but is near to the point)


huh?

> in the end i think what you want can be implemented if you
> > have the ability
> > to mount the homepage on "/" with the index coding strategy. coding
> > strategies for the homepage or "/" is not something we
> > support right now. so
> > if you think this will solve your usecase add an rfe to the jira.
>
> this point is now what i call constructive - in the thread i got no
> solution
> or anything mentioned near to that, but a "no", "dont work" etc.


what you got was an explanation of why what you were doing was wrong. that
is very constructive imho, you just need to listen. dont forget it is not
our job to tell you how to solve your problems - so take any help you can
get.

regarding the "/" mount for the app Home Page: isn't this an JEE antipattern
> as the welcome-page should be declared in web.xml?


"/" is relative to your servlet mapping not the "context/" unless you map it
that way - it is up to you.

-igor



regards
>
> Korbinian
>
>
>
> >
> > -igor
> >
> > > -----Ursprüngliche Nachricht-----
> > > > Von: Johan Compagner [mailto:jcompagner@gmail.com]
> > > > Gesendet: Donnerstag, 16. November 2006 14:50
> > > > An: wicket-dev@incubator.apache.org
> > > > Betreff: Re: wicket2 / multi-mounts to class
> > > >
> > > > > so you manually change your link to be at the mountpoint...
> > > >
> > > >
> > > >
> > > > Where do you manually change it?
> > > > I was just pointing out that the 2 mount params must be in
> > > > sync in wicket else it doesn't work by default. If somebody
> > > > makes a mistake an configures it like i said it goes wrong.
> > > > The url will be encoded to something that when it is clicked
> > > > on will not be decoded.
> > > > That why it is dangerous to have the mount(string,coder)
> > > > method and why it is removed in wicket 2.0 (and it will
> > stay that way)
> > > >
> > > >
> > > > URLs are build like that: preParams / postParams
> > > > > while the first part of the preParams is the mountpoint...
> > > > >
> > > > > i didnt consider it a bug, but a big feature as it also
> > allows even
> > > > > the most complicated URL creation schemes as well as
> > more enhanced
> > > > > CodingStrategies
> > > >
> > > >
> > > >
> > > > Where do you use  your coding strategies then for then?
> > > > Because or you don't use it completely for the encoding
> > > > (setResponsePage(
> > > > Page.class))
> > > > or you don't use it complete for the decoding when a
> > request comes in.
> > > >
> > > > mount("/path/to/page2", new
> > > > > > BookmarkablePageRequestTargetUrlCodingStrategy("",
> > > > > > Page2.class,null));
> > > > >
> > > > > is IMHO not a mountpoint but a pain - a mountpoint is a "short"
> > > > > description
> > > > > of what comes to a page
> > > > >
> > > > > e.g: "/path/" would be enough here... everything of a URL
> > > > is logic -
> > > > > and that has to be handled by the appropriate class and
> > not coded
> > > > > fixed into a init function
> > > >
> > > >
> > > >
> > > > That was just an example fine we use your example:
> > > >
> > > > mount("/path", new
> > BookmarkablePageRequestTargetUrlCodingStrategy("",
> > > > Page2.class,null));
> > > >
> > > > Still doesn't work at all.
> > > > The encode will generate a "/" url (with nothing behind it if
> > > > there are no page params) the decode will only accept urls
> > > > that starts with "/path"
> > > >
> > > > johan
> > > >
> > >
> > >
> >
>
>

AW: wicket2 / multi-mounts to class

Posted by Korbinian Bachl <ko...@whiskyworld.de>.
 

> > > That why it is dangerous to have the mount(string,coder) 
> method and 
> > > why it is removed in wicket 2.0 (and it will stay that way)
> >
> > ok, basically this comes to: you never got it working/ dont 
> understand 
> > it so stripped it...
> 
> 
> what a stupid thing to say considering it was probably johan 
> that wrote that
> part of the code in the first place. you wont be making any 
> friends here
> saying things like these.

i replied to his statement - and if im on a black list cause i critizise
him, so it be. i dont know if he wrote that or did it as i never made him
resonsible for that, the thing i dont like is this eternal "and will stay" -


> you used that api in a way it was not meant to be used. it is 
> "lucky" that
> it worked for you because it was not our intention to make 
> your usecase
> work. this why we stripped this functionality. btw, it was 
> stripped way
> before you showed up or someone tried to do what you did.

maybe it wasnt meant for this... the internet wasnt meant to be what its
today, so should we strip it away?
(yes, this was polemic but is near to the point)

> 
> in the end i think what you want can be implemented if you 
> have the ability
> to mount the homepage on "/" with the index coding strategy. coding
> strategies for the homepage or "/" is not something we 
> support right now. so
> if you think this will solve your usecase add an rfe to the jira.

this point is now what i call constructive - in the thread i got no solution
or anything mentioned near to that, but a "no", "dont work" etc.

regarding the "/" mount for the app Home Page: isn't this an JEE antipattern
as the welcome-page should be declared in web.xml?

regards

Korbinian



> 
> -igor
> 
> > -----Ursprüngliche Nachricht-----
> > > Von: Johan Compagner [mailto:jcompagner@gmail.com]
> > > Gesendet: Donnerstag, 16. November 2006 14:50
> > > An: wicket-dev@incubator.apache.org
> > > Betreff: Re: wicket2 / multi-mounts to class
> > >
> > > > so you manually change your link to be at the mountpoint...
> > >
> > >
> > >
> > > Where do you manually change it?
> > > I was just pointing out that the 2 mount params must be in
> > > sync in wicket else it doesn't work by default. If somebody
> > > makes a mistake an configures it like i said it goes wrong.
> > > The url will be encoded to something that when it is clicked
> > > on will not be decoded.
> > > That why it is dangerous to have the mount(string,coder)
> > > method and why it is removed in wicket 2.0 (and it will 
> stay that way)
> > >
> > >
> > > URLs are build like that: preParams / postParams
> > > > while the first part of the preParams is the mountpoint...
> > > >
> > > > i didnt consider it a bug, but a big feature as it also 
> allows even
> > > > the most complicated URL creation schemes as well as 
> more enhanced
> > > > CodingStrategies
> > >
> > >
> > >
> > > Where do you use  your coding strategies then for then?
> > > Because or you don't use it completely for the encoding
> > > (setResponsePage(
> > > Page.class))
> > > or you don't use it complete for the decoding when a 
> request comes in.
> > >
> > > mount("/path/to/page2", new
> > > > > BookmarkablePageRequestTargetUrlCodingStrategy("",
> > > > > Page2.class,null));
> > > >
> > > > is IMHO not a mountpoint but a pain - a mountpoint is a "short"
> > > > description
> > > > of what comes to a page
> > > >
> > > > e.g: "/path/" would be enough here... everything of a URL
> > > is logic -
> > > > and that has to be handled by the appropriate class and 
> not coded
> > > > fixed into a init function
> > >
> > >
> > >
> > > That was just an example fine we use your example:
> > >
> > > mount("/path", new 
> BookmarkablePageRequestTargetUrlCodingStrategy("",
> > > Page2.class,null));
> > >
> > > Still doesn't work at all.
> > > The encode will generate a "/" url (with nothing behind it if
> > > there are no page params) the decode will only accept urls
> > > that starts with "/path"
> > >
> > > johan
> > >
> >
> >
> 


Re: wicket2 / multi-mounts to class

Posted by Igor Vaynberg <ig...@gmail.com>.
On 11/16/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
>
> > That why it is dangerous to have the mount(string,coder)
> > method and why it is removed in wicket 2.0 (and it will stay that way)
>
> ok, basically this comes to: you never got it working/ dont understand it
> so
> stripped it...


what a stupid thing to say considering it was probably johan that wrote that
part of the code in the first place. you wont be making any friends here
saying things like these.

ok if this is your way


as implementors of the framework our primary concern is to make sure our api
is clear for our users. sometimes this means stripping things that we later
realize can be confusing or have a high chance of being error-prone when
used.

- im not discussing this item anyonger, ill use a own implementation and
> thats it...


our secondary concern is to leave enough hooks/flexibility in the api so our
users can customize the existing default functionality

but dont wonder if more
> people complain if you strip out existent functionality...


you used that api in a way it was not meant to be used. it is "lucky" that
it worked for you because it was not our intention to make your usecase
work. this why we stripped this functionality. btw, it was stripped way
before you showed up or someone tried to do what you did.

in the end i think what you want can be implemented if you have the ability
to mount the homepage on "/" with the index coding strategy. coding
strategies for the homepage or "/" is not something we support right now. so
if you think this will solve your usecase add an rfe to the jira.

-igor

> -----Ursprüngliche Nachricht-----
> > Von: Johan Compagner [mailto:jcompagner@gmail.com]
> > Gesendet: Donnerstag, 16. November 2006 14:50
> > An: wicket-dev@incubator.apache.org
> > Betreff: Re: wicket2 / multi-mounts to class
> >
> > > so you manually change your link to be at the mountpoint...
> >
> >
> >
> > Where do you manually change it?
> > I was just pointing out that the 2 mount params must be in
> > sync in wicket else it doesn't work by default. If somebody
> > makes a mistake an configures it like i said it goes wrong.
> > The url will be encoded to something that when it is clicked
> > on will not be decoded.
> > That why it is dangerous to have the mount(string,coder)
> > method and why it is removed in wicket 2.0 (and it will stay that way)
> >
> >
> > URLs are build like that: preParams / postParams
> > > while the first part of the preParams is the mountpoint...
> > >
> > > i didnt consider it a bug, but a big feature as it also allows even
> > > the most complicated URL creation schemes as well as more enhanced
> > > CodingStrategies
> >
> >
> >
> > Where do you use  your coding strategies then for then?
> > Because or you don't use it completely for the encoding
> > (setResponsePage(
> > Page.class))
> > or you don't use it complete for the decoding when a request comes in.
> >
> > mount("/path/to/page2", new
> > > > BookmarkablePageRequestTargetUrlCodingStrategy("",
> > > > Page2.class,null));
> > >
> > > is IMHO not a mountpoint but a pain - a mountpoint is a "short"
> > > description
> > > of what comes to a page
> > >
> > > e.g: "/path/" would be enough here... everything of a URL
> > is logic -
> > > and that has to be handled by the appropriate class and not coded
> > > fixed into a init function
> >
> >
> >
> > That was just an example fine we use your example:
> >
> > mount("/path", new BookmarkablePageRequestTargetUrlCodingStrategy("",
> > Page2.class,null));
> >
> > Still doesn't work at all.
> > The encode will generate a "/" url (with nothing behind it if
> > there are no page params) the decode will only accept urls
> > that starts with "/path"
> >
> > johan
> >
>
>

AW: wicket2 / multi-mounts to class

Posted by Korbinian Bachl <ko...@whiskyworld.de>.
> That why it is dangerous to have the mount(string,coder) 
> method and why it is removed in wicket 2.0 (and it will stay that way)

ok, basically this comes to: you never got it working/ dont understand it so
stripped it... ok if this is your way - im not discussing this item any
longer, ill use a own implementation and thats it... but dont wonder if more
people complain if you strip out existent functionality... 
 

> -----Ursprüngliche Nachricht-----
> Von: Johan Compagner [mailto:jcompagner@gmail.com] 
> Gesendet: Donnerstag, 16. November 2006 14:50
> An: wicket-dev@incubator.apache.org
> Betreff: Re: wicket2 / multi-mounts to class
> 
> > so you manually change your link to be at the mountpoint...
> 
> 
> 
> Where do you manually change it?
> I was just pointing out that the 2 mount params must be in 
> sync in wicket else it doesn't work by default. If somebody 
> makes a mistake an configures it like i said it goes wrong. 
> The url will be encoded to something that when it is clicked 
> on will not be decoded.
> That why it is dangerous to have the mount(string,coder) 
> method and why it is removed in wicket 2.0 (and it will stay that way)
> 
> 
> URLs are build like that: preParams / postParams
> > while the first part of the preParams is the mountpoint...
> >
> > i didnt consider it a bug, but a big feature as it also allows even 
> > the most complicated URL creation schemes as well as more enhanced 
> > CodingStrategies
> 
> 
> 
> Where do you use  your coding strategies then for then?
> Because or you don't use it completely for the encoding  
> (setResponsePage(
> Page.class))
> or you don't use it complete for the decoding when a request comes in.
> 
> mount("/path/to/page2", new
> > > BookmarkablePageRequestTargetUrlCodingStrategy("", 
> > > Page2.class,null));
> >
> > is IMHO not a mountpoint but a pain - a mountpoint is a "short"
> > description
> > of what comes to a page
> >
> > e.g: "/path/" would be enough here... everything of a URL 
> is logic - 
> > and that has to be handled by the appropriate class and not coded 
> > fixed into a init function
> 
> 
> 
> That was just an example fine we use your example:
> 
> mount("/path", new BookmarkablePageRequestTargetUrlCodingStrategy("",
> Page2.class,null));
> 
> Still doesn't work at all.
> The encode will generate a "/" url (with nothing behind it if 
> there are no page params) the decode will only accept urls 
> that starts with "/path"
> 
> johan
> 


Re: wicket2 / multi-mounts to class

Posted by Johan Compagner <jc...@gmail.com>.
> so you manually change your link to be at the mountpoint...



Where do you manually change it?
I was just pointing out that the 2 mount params must be in sync in wicket
else it doesn't work by default. If somebody makes a mistake an configures
it like i said
it goes wrong. The url will be encoded to something that when it is clicked
on will not be decoded.
That why it is dangerous to have the mount(string,coder) method and why it
is removed in wicket 2.0
(and it will stay that way)


URLs are build like that: preParams / postParams
> while the first part of the preParams is the mountpoint...
>
> i didnt consider it a bug, but a big feature as it also allows even the
> most
> complicated URL creation schemes as well as more enhanced CodingStrategies



Where do you use  your coding strategies then for then?
Because or you don't use it completely for the encoding  (setResponsePage(
Page.class))
or you don't use it complete for the decoding when a request comes in.

mount("/path/to/page2", new
> > BookmarkablePageRequestTargetUrlCodingStrategy("", Page2.class,null));
>
> is IMHO not a mountpoint but a pain - a mountpoint is a "short"
> description
> of what comes to a page
>
> e.g: "/path/" would be enough here... everything of a URL is logic - and
> that has to be handled by the appropriate class and not coded fixed into a
> init function



That was just an example fine we use your example:

mount("/path", new BookmarkablePageRequestTargetUrlCodingStrategy("",
Page2.class,null));

Still doesn't work at all.
The encode will generate a "/" url (with nothing behind it if there are no
page params)
the decode will only accept urls that starts with "/path"

johan

AW: wicket2 / multi-mounts to class

Posted by Korbinian Bachl <ko...@whiskyworld.de>.
yeah, but you forgot to put the appropriate first (and following) page param
to it:

"/path/to/page2" -> these are the prePageParams for me here, that i grab
each time i use a new one...

so you manually change your link to be at the mountpoint... 

URLs are build like that: preParams / postParams
while the first part of the preParams is the mountpoint... 

i didnt consider it a bug, but a big feature as it also allows even the most
complicated URL creation schemes as well as more enhanced CodingStrategies

regards

PS: 

mount("/path/to/page2", new
> BookmarkablePageRequestTargetUrlCodingStrategy("", Page2.class,null));

is IMHO not a mountpoint but a pain - a mountpoint is a "short" description
of what comes to a page

e.g: "/path/" would be enough here... everything of a URL is logic - and
that has to be handled by the appropriate class and not coded fixed into a
init function



> -----Ursprüngliche Nachricht-----
> Von: Johan Compagner [mailto:jcompagner@gmail.com] 
> Gesendet: Donnerstag, 16. November 2006 00:06
> An: wicket-dev@incubator.apache.org
> Betreff: Re: wicket2 / multi-mounts to class
> 
> If that works somehow for you then that a bug and should be 
> fixed It is not a feature
> 
> i just tried it in the nice url example and it is exactly how 
> i expected it to happen:
> 
> i changed these 2 lines:
> 
> //        mountBookmarkablePage("/a/nice/path/to/the/first/page",
> Page1.class);
> //        mountBookmarkablePage("/path/to/page2.html", Page2.class);
> 
> into this:
> 
>         mount("/path/to/page2", new
> BookmarkablePageRequestTargetUrlCodingStrategy("", Page2.class,null));
>         mount("/other/to/page1", new
> BookmarkablePageRequestTargetUrlCodingStrategy("/other2/to/page1",
> Page1.class,null));
> 
> and what a suprice
> the link to page2 is just to root of the webapp (so clicking 
> on the page2 link will just give me the index/homepage of the 
> niceurl example) clicking on page1 will give me an error page 
> ofcourse HTTP Status 404 -
> ------------------------------
> 
> *type* Status report
> 
> *message*
> 
> *description* *The requested resource () is not available.*
> 
> 
> And this is also logical ofcourse because the url that is generated:
> /other2/to/page1  can't be resolved because there is no mount 
> path resolving to that.
> 
> johan
> 
> 
> 
> On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> >
> > > It just has to be in sync. So thats why i removed that 
> param in the 
> > > mount.
> >
> > thats the point !
> >
> > currently you can take it out of sync in wicket 1.2.x if you want - 
> > while in 2.0 you're forbidden to do so -> loss of functionality
> >
> > the thing that i do is to hold a (pre)PageParam in my 
> session and add 
> > it at the beginning of the params
> >
> > e.g: params = (somesession)getSession().getNewParams;
> > params.add(Integer.toString(params.size()),"foo");
> > while in the session the params are hold all over - so i 
> can initalize 
> > language and have it before the page, letting the website urls look 
> > multilanguaged
> >
> > e.g:
> > /en/index
> > /de/index
> > /fr/index
> >
> > if you look at a URL paradigm then it has a preParameter, a 
> Page and a 
> > postParameter
> >
> > -> /pre/page/post
> > so what i do is to hook on the pre Part and mount it to it, 
> the page 
> > is a category-key from the database and the post-params are further 
> > config params to it
> >
> > > So i your case it is very strange that it works (as you say i 
> > > haven't tested
> > > it)
> > > because you do this:
> > >
> > > mount("/en",new IndexedParamUrlCodingStrategy("",Katalog.class));
> >
> > well - its strange but it works. I can send you a small 
> demoApp if you 
> > would like to see, and i really like the paradigm where the 
> URL is as 
> > clear as possible... and by using a config singleton i can find out 
> > everytime in every component wich param is good for it (as 
> all numbers 
> > in that way are relative to the ones you specify in the prePart)
> >
> > Regards
> >
> >
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Johan Compagner [mailto:jcompagner@gmail.com]
> > > Gesendet: Mittwoch, 15. November 2006 22:22
> > > An: wicket-dev@incubator.apache.org
> > > Betreff: Re: wicket2 / multi-mounts to class
> > >
> > > no you didn't understand it.
> > >
> > > If you don't have exactly the same parameter in this call:
> > >
> > > mount("/de",new 
> IndexedParamUrlCodingStrategy("/de",Katalog.class));
> > >
> > > So if it was this:
> > >
> > > mount("/en",new 
> IndexedParamUrlCodingStrategy("/de",Katalog.class));
> > >
> > > Then it doesn't work. The request target will generate an 
> url that 
> > > will start with "/de"
> > > but incomming request that now have a path "/de/xxxx" don't match 
> > > with the "/en"  key where the strategy is mapped on. So it does't 
> > > match.
> > >
> > >
> > > So i your case it is very strange that it works (as you say i 
> > > haven't tested
> > > it)
> > > because you do this:
> > >
> > > mount("/en",new IndexedParamUrlCodingStrategy("",Katalog.class));
> > >
> > > then the coding strategy makes urls without the /en mount like 
> > > /ParamA/ParamB
> > >
> > > then the url comes back in
> > > but /ParamA/ParamB doesn't start with "/en" so it doesn't map on 
> > > your coding strategy.
> > > So who is decoding it??
> > >
> > > It just has to be in sync. So thats why i removed that 
> param in the 
> > > mount.
> > > It doesn't make any sense that it is not in sync.
> > >
> > > johan
> > >
> > >
> > >
> > > On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> > > >
> > > > it did.  you just didnt understand it yet -
> > > >
> > > > in wicket 1.x you can mount a page to
> > > >
> > > > /de
> > > > /en
> > > > and not having the IndexedPar...egy putting the /de
> > > everytime in front
> > > > - but you were responsible for that by having the 0 param
> > > beeing set
> > > > to e.g: de .
> > > > A nice URL paradigm begins by creating it on paper and by
> > > putting out
> > > > everything you dont want - and even if you prefer component or 
> > > > not, its a missioncritical thing nowadays for public websites 
> > > > (security, spiders
> > > > etc.)
> > > >
> > > > e.g: having only 1 (!) active mount in wicket 2.0 like now 
> > > > destroys this completely, what in wicket 1.x worked
> > > >
> > > > imagine you have a big business site, and the paradigm 
> tells you 
> > > > to order the language by var URL paradigms, whereas /en and
> > > /de are new
> > > > and reworked by using wicket, while /cn and /ar are old
> > > ones managed
> > > > by other systems...
> > > > or a shop that has to show prices for various countries 
> in various 
> > > > languages you need to put it anywhere to, when the page 
> should be 
> > > > bookmarkable and nice
> > > >
> > > > so we have 2 paradigms:
> > > >
> > > > - /page/lang/params
> > > > - /lang/params
> > > >
> > > > wich one is nicer ? the second, as it allows you to be as
> > > flexible as
> > > > you want and this was what i like in wicket 1.x - you were
> > > free to do
> > > > what you want, not forced to develop your own thing if you
> > > need it...
> > > >
> > > > in wicket 1.x you can just use the mount("/de/", new 
> > > > IndexedParamUrlCodingStrategy("",Katalog.class));
> > > > telling him he has pages mounted unter "/de/" and they 
> should use 
> > > > a IndexedParam without any special thing to it, while in
> > > wicket 2 this
> > > > has been stripped and now forces us to have a 
> CodingStrategy that 
> > > > relies on other things
> > > >
> > > > you also cant then easily upgrade older URLCodingStrategies
> > > as mount
> > > > no longer can be used to mount a path and a strategy 
> but only the 
> > > > strategy alone...
> > > >
> > > > i understand most changes in wicket2, as they have more 
> pros then 
> > > > cons, but this one has only cons as i dont see any 
> advancement but 
> > > > lost base-functionality
> > > >
> > > > Regards
> > > >
> > > > Korbinian
> > > >
> > > >
> > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: Johan Compagner [mailto:jcompagner@gmail.com]
> > > > > Gesendet: Mittwoch, 15. November 2006 16:35
> > > > > An: wicket-dev@incubator.apache.org
> > > > > Betreff: Re: wicket2 / multi-mounts to class
> > > > >
> > > > > the param didn't make any sense because the first 
> param was only 
> > > > > used to put in in a map and the string you put into the
> > > strategy is
> > > > > used in the decode and encode so having 2 params which
> > > are not the
> > > > > same don't make any sense. Because the urls generated 
> then don't 
> > > > > really map anymore on the param that is in the map.
> > > > >
> > > > > So what does the first param of mount in wicket 1.x 
> really mean?
> > > > >
> > > > > why not just do one mount:
> > > > >
> > > > > mount(new 
> > > > > IndexedParamUrlCodingStrategy("/global",Katalog.class));
> > > > >
> > > > > and then do anything you want after that??
> > > > >
> > > > > /global/x
> > > > > /global/y
> > > > > /global/z
> > > > >
> > > > > all go to one class, that is one mount.
> > > > >
> > > > > johan
> > > > >
> > > > >
> > > > >
> > > > > On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > in wicket 1.x you can do following:
> > > > > >
> > > > > > mount("/de/", new
> > > > > > IndexedParamUrlCodingStrategy("",Katalog.class));
> > > > > > mount("/en/", new
> > > > > > IndexedParamUrlCodingStrategy("",Katalog.class));
> > > > > >
> > > > > > while in wicket 2.0 you only can do:
> > > > > >
> > > > > > mount(new 
> IndexedParamUrlCodingStrategy("/de",Katalog.class));
> > > > > > mount(new 
> IndexedParamUrlCodingStrategy("/en",Katalog.class));
> > > > > >
> > > > > > wich then means that you cant switch by the 0 - Param
> > > the path...
> > > > > > meaning if you enter /IndexA/Foo/Bar you cant have 
> a link to 
> > > > > > /IndexB/Foo/Bar by just using PageParams("0=Foo,1=Bar")
> > > > > > (similar..)
> > > > > >
> > > > > > (the /de and /en here is the language for example)
> > > > > >
> > > > > >
> > > > > > is there a way to do this? else i would make a Jira
> > > > > featurerequest as
> > > > > > this behaviour is vital for me... i need to be able to have
> > > > > at least N
> > > > > > paths that are mounted to a single class and can then be
> > > > > switched by
> > > > > > the first request param.
> > > > > >
> > > > > > Best Regards
> > > > > >
> > > > > > Korbinian
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
> 


Re: wicket2 / multi-mounts to class

Posted by Johan Compagner <jc...@gmail.com>.
If that works somehow for you then that a bug and should be fixed
It is not a feature

i just tried it in the nice url example and it is exactly how i expected it
to happen:

i changed these 2 lines:

//        mountBookmarkablePage("/a/nice/path/to/the/first/page",
Page1.class);
//        mountBookmarkablePage("/path/to/page2.html", Page2.class);

into this:

        mount("/path/to/page2", new
BookmarkablePageRequestTargetUrlCodingStrategy("", Page2.class,null));
        mount("/other/to/page1", new
BookmarkablePageRequestTargetUrlCodingStrategy("/other2/to/page1",
Page1.class,null));

and what a suprice
the link to page2 is just to root of the webapp (so clicking on the page2
link will just give me the index/homepage of the niceurl example)
clicking on page1 will give me an error page ofcourse
HTTP Status 404 -
------------------------------

*type* Status report

*message*

*description* *The requested resource () is not available.*


And this is also logical ofcourse because the url that is generated:
/other2/to/page1  can't be resolved because there is no mount path resolving
to that.

johan



On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
>
> > It just has to be in sync. So thats why i removed that param
> > in the mount.
>
> thats the point !
>
> currently you can take it out of sync in wicket 1.2.x if you want - while
> in
> 2.0 you're forbidden to do so -> loss of functionality
>
> the thing that i do is to hold a (pre)PageParam in my session and add it
> at
> the beginning of the params
>
> e.g: params = (somesession)getSession().getNewParams;
> params.add(Integer.toString(params.size()),"foo");
> while in the session the params are hold all over - so i can initalize
> language and have it before the page, letting the website urls look
> multilanguaged
>
> e.g:
> /en/index
> /de/index
> /fr/index
>
> if you look at a URL paradigm then it has a preParameter, a Page and a
> postParameter
>
> -> /pre/page/post
> so what i do is to hook on the pre Part and mount it to it, the page is a
> category-key from the database and the post-params are further config
> params
> to it
>
> > So i your case it is very strange that it works (as you say i
> > haven't tested
> > it)
> > because you do this:
> >
> > mount("/en",new IndexedParamUrlCodingStrategy("",Katalog.class));
>
> well - its strange but it works. I can send you a small demoApp if you
> would
> like to see, and i really like the paradigm where the URL is as clear as
> possible... and by using a config singleton i can find out everytime in
> every component wich param is good for it (as all numbers in that way are
> relative to the ones you specify in the prePart)
>
> Regards
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Johan Compagner [mailto:jcompagner@gmail.com]
> > Gesendet: Mittwoch, 15. November 2006 22:22
> > An: wicket-dev@incubator.apache.org
> > Betreff: Re: wicket2 / multi-mounts to class
> >
> > no you didn't understand it.
> >
> > If you don't have exactly the same parameter in this call:
> >
> > mount("/de",new IndexedParamUrlCodingStrategy("/de",Katalog.class));
> >
> > So if it was this:
> >
> > mount("/en",new IndexedParamUrlCodingStrategy("/de",Katalog.class));
> >
> > Then it doesn't work. The request target will generate an url
> > that will start with "/de"
> > but incomming request that now have a path "/de/xxxx" don't
> > match with the "/en"  key where the strategy is mapped on. So
> > it does't match.
> >
> >
> > So i your case it is very strange that it works (as you say i
> > haven't tested
> > it)
> > because you do this:
> >
> > mount("/en",new IndexedParamUrlCodingStrategy("",Katalog.class));
> >
> > then the coding strategy makes urls without the /en mount
> > like /ParamA/ParamB
> >
> > then the url comes back in
> > but /ParamA/ParamB doesn't start with "/en" so it doesn't map
> > on your coding strategy.
> > So who is decoding it??
> >
> > It just has to be in sync. So thats why i removed that param
> > in the mount.
> > It doesn't make any sense that it is not in sync.
> >
> > johan
> >
> >
> >
> > On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> > >
> > > it did.  you just didnt understand it yet -
> > >
> > > in wicket 1.x you can mount a page to
> > >
> > > /de
> > > /en
> > > and not having the IndexedPar...egy putting the /de
> > everytime in front
> > > - but you were responsible for that by having the 0 param
> > beeing set
> > > to e.g: de .
> > > A nice URL paradigm begins by creating it on paper and by
> > putting out
> > > everything you dont want - and even if you prefer component or not,
> > > its a missioncritical thing nowadays for public websites (security,
> > > spiders
> > > etc.)
> > >
> > > e.g: having only 1 (!) active mount in wicket 2.0 like now destroys
> > > this completely, what in wicket 1.x worked
> > >
> > > imagine you have a big business site, and the paradigm tells you to
> > > order the language by var URL paradigms, whereas /en and
> > /de are new
> > > and reworked by using wicket, while /cn and /ar are old
> > ones managed
> > > by other systems...
> > > or a shop that has to show prices for various countries in various
> > > languages you need to put it anywhere to, when the page should be
> > > bookmarkable and nice
> > >
> > > so we have 2 paradigms:
> > >
> > > - /page/lang/params
> > > - /lang/params
> > >
> > > wich one is nicer ? the second, as it allows you to be as
> > flexible as
> > > you want and this was what i like in wicket 1.x - you were
> > free to do
> > > what you want, not forced to develop your own thing if you
> > need it...
> > >
> > > in wicket 1.x you can just use the
> > > mount("/de/", new IndexedParamUrlCodingStrategy("",Katalog.class));
> > > telling him he has pages mounted unter "/de/" and they should use a
> > > IndexedParam without any special thing to it, while in
> > wicket 2 this
> > > has been stripped and now forces us to have a CodingStrategy that
> > > relies on other things
> > >
> > > you also cant then easily upgrade older URLCodingStrategies
> > as mount
> > > no longer can be used to mount a path and a strategy but only the
> > > strategy alone...
> > >
> > > i understand most changes in wicket2, as they have more pros then
> > > cons, but this one has only cons as i dont see any advancement but
> > > lost base-functionality
> > >
> > > Regards
> > >
> > > Korbinian
> > >
> > >
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Johan Compagner [mailto:jcompagner@gmail.com]
> > > > Gesendet: Mittwoch, 15. November 2006 16:35
> > > > An: wicket-dev@incubator.apache.org
> > > > Betreff: Re: wicket2 / multi-mounts to class
> > > >
> > > > the param didn't make any sense because the first param was only
> > > > used to put in in a map and the string you put into the
> > strategy is
> > > > used in the decode and encode so having 2 params which
> > are not the
> > > > same don't make any sense. Because the urls generated then don't
> > > > really map anymore on the param that is in the map.
> > > >
> > > > So what does the first param of mount in wicket 1.x really mean?
> > > >
> > > > why not just do one mount:
> > > >
> > > > mount(new IndexedParamUrlCodingStrategy("/global",Katalog.class));
> > > >
> > > > and then do anything you want after that??
> > > >
> > > > /global/x
> > > > /global/y
> > > > /global/z
> > > >
> > > > all go to one class, that is one mount.
> > > >
> > > > johan
> > > >
> > > >
> > > >
> > > > On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > in wicket 1.x you can do following:
> > > > >
> > > > > mount("/de/", new
> > > > > IndexedParamUrlCodingStrategy("",Katalog.class));
> > > > > mount("/en/", new
> > > > > IndexedParamUrlCodingStrategy("",Katalog.class));
> > > > >
> > > > > while in wicket 2.0 you only can do:
> > > > >
> > > > > mount(new IndexedParamUrlCodingStrategy("/de",Katalog.class));
> > > > > mount(new IndexedParamUrlCodingStrategy("/en",Katalog.class));
> > > > >
> > > > > wich then means that you cant switch by the 0 - Param
> > the path...
> > > > > meaning if you enter /IndexA/Foo/Bar you cant have a link to
> > > > > /IndexB/Foo/Bar by just using PageParams("0=Foo,1=Bar")
> > > > > (similar..)
> > > > >
> > > > > (the /de and /en here is the language for example)
> > > > >
> > > > >
> > > > > is there a way to do this? else i would make a Jira
> > > > featurerequest as
> > > > > this behaviour is vital for me... i need to be able to have
> > > > at least N
> > > > > paths that are mounted to a single class and can then be
> > > > switched by
> > > > > the first request param.
> > > > >
> > > > > Best Regards
> > > > >
> > > > > Korbinian
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

AW: wicket2 / multi-mounts to class

Posted by Korbinian Bachl <ko...@whiskyworld.de>.
 > It just has to be in sync. So thats why i removed that param 
> in the mount.

thats the point ! 

currently you can take it out of sync in wicket 1.2.x if you want - while in
2.0 you're forbidden to do so -> loss of functionality

the thing that i do is to hold a (pre)PageParam in my session and add it at
the beginning of the params

e.g: params = (somesession)getSession().getNewParams;
params.add(Integer.toString(params.size()),"foo");
while in the session the params are hold all over - so i can initalize
language and have it before the page, letting the website urls look
multilanguaged

e.g: 
/en/index
/de/index
/fr/index

if you look at a URL paradigm then it has a preParameter, a Page and a
postParameter

-> /pre/page/post
so what i do is to hook on the pre Part and mount it to it, the page is a
category-key from the database and the post-params are further config params
to it

> So i your case it is very strange that it works (as you say i 
> haven't tested
> it)
> because you do this:
> 
> mount("/en",new IndexedParamUrlCodingStrategy("",Katalog.class));

well - its strange but it works. I can send you a small demoApp if you would
like to see, and i really like the paradigm where the URL is as clear as
possible... and by using a config singleton i can find out everytime in
every component wich param is good for it (as all numbers in that way are
relative to the ones you specify in the prePart)

Regards



> -----Ursprüngliche Nachricht-----
> Von: Johan Compagner [mailto:jcompagner@gmail.com] 
> Gesendet: Mittwoch, 15. November 2006 22:22
> An: wicket-dev@incubator.apache.org
> Betreff: Re: wicket2 / multi-mounts to class
> 
> no you didn't understand it.
> 
> If you don't have exactly the same parameter in this call:
> 
> mount("/de",new IndexedParamUrlCodingStrategy("/de",Katalog.class));
> 
> So if it was this:
> 
> mount("/en",new IndexedParamUrlCodingStrategy("/de",Katalog.class));
> 
> Then it doesn't work. The request target will generate an url 
> that will start with "/de"
> but incomming request that now have a path "/de/xxxx" don't 
> match with the "/en"  key where the strategy is mapped on. So 
> it does't match.
> 
> 
> So i your case it is very strange that it works (as you say i 
> haven't tested
> it)
> because you do this:
> 
> mount("/en",new IndexedParamUrlCodingStrategy("",Katalog.class));
> 
> then the coding strategy makes urls without the /en mount 
> like /ParamA/ParamB
> 
> then the url comes back in
> but /ParamA/ParamB doesn't start with "/en" so it doesn't map 
> on your coding strategy.
> So who is decoding it??
> 
> It just has to be in sync. So thats why i removed that param 
> in the mount.
> It doesn't make any sense that it is not in sync.
> 
> johan
> 
> 
> 
> On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> >
> > it did.  you just didnt understand it yet -
> >
> > in wicket 1.x you can mount a page to
> >
> > /de
> > /en
> > and not having the IndexedPar...egy putting the /de 
> everytime in front 
> > - but you were responsible for that by having the 0 param 
> beeing set 
> > to e.g: de .
> > A nice URL paradigm begins by creating it on paper and by 
> putting out 
> > everything you dont want - and even if you prefer component or not, 
> > its a missioncritical thing nowadays for public websites (security, 
> > spiders
> > etc.)
> >
> > e.g: having only 1 (!) active mount in wicket 2.0 like now destroys 
> > this completely, what in wicket 1.x worked
> >
> > imagine you have a big business site, and the paradigm tells you to 
> > order the language by var URL paradigms, whereas /en and 
> /de are new 
> > and reworked by using wicket, while /cn and /ar are old 
> ones managed 
> > by other systems...
> > or a shop that has to show prices for various countries in various 
> > languages you need to put it anywhere to, when the page should be 
> > bookmarkable and nice
> >
> > so we have 2 paradigms:
> >
> > - /page/lang/params
> > - /lang/params
> >
> > wich one is nicer ? the second, as it allows you to be as 
> flexible as 
> > you want and this was what i like in wicket 1.x - you were 
> free to do 
> > what you want, not forced to develop your own thing if you 
> need it...
> >
> > in wicket 1.x you can just use the
> > mount("/de/", new IndexedParamUrlCodingStrategy("",Katalog.class));
> > telling him he has pages mounted unter "/de/" and they should use a 
> > IndexedParam without any special thing to it, while in 
> wicket 2 this 
> > has been stripped and now forces us to have a CodingStrategy that 
> > relies on other things
> >
> > you also cant then easily upgrade older URLCodingStrategies 
> as mount 
> > no longer can be used to mount a path and a strategy but only the 
> > strategy alone...
> >
> > i understand most changes in wicket2, as they have more pros then 
> > cons, but this one has only cons as i dont see any advancement but 
> > lost base-functionality
> >
> > Regards
> >
> > Korbinian
> >
> >
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Johan Compagner [mailto:jcompagner@gmail.com]
> > > Gesendet: Mittwoch, 15. November 2006 16:35
> > > An: wicket-dev@incubator.apache.org
> > > Betreff: Re: wicket2 / multi-mounts to class
> > >
> > > the param didn't make any sense because the first param was only 
> > > used to put in in a map and the string you put into the 
> strategy is 
> > > used in the decode and encode so having 2 params which 
> are not the 
> > > same don't make any sense. Because the urls generated then don't 
> > > really map anymore on the param that is in the map.
> > >
> > > So what does the first param of mount in wicket 1.x really mean?
> > >
> > > why not just do one mount:
> > >
> > > mount(new IndexedParamUrlCodingStrategy("/global",Katalog.class));
> > >
> > > and then do anything you want after that??
> > >
> > > /global/x
> > > /global/y
> > > /global/z
> > >
> > > all go to one class, that is one mount.
> > >
> > > johan
> > >
> > >
> > >
> > > On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> > > >
> > > > Hi,
> > > >
> > > > in wicket 1.x you can do following:
> > > >
> > > > mount("/de/", new 
> > > > IndexedParamUrlCodingStrategy("",Katalog.class));
> > > > mount("/en/", new 
> > > > IndexedParamUrlCodingStrategy("",Katalog.class));
> > > >
> > > > while in wicket 2.0 you only can do:
> > > >
> > > > mount(new IndexedParamUrlCodingStrategy("/de",Katalog.class));
> > > > mount(new IndexedParamUrlCodingStrategy("/en",Katalog.class));
> > > >
> > > > wich then means that you cant switch by the 0 - Param 
> the path...
> > > > meaning if you enter /IndexA/Foo/Bar you cant have a link to 
> > > > /IndexB/Foo/Bar by just using PageParams("0=Foo,1=Bar") 
> > > > (similar..)
> > > >
> > > > (the /de and /en here is the language for example)
> > > >
> > > >
> > > > is there a way to do this? else i would make a Jira
> > > featurerequest as
> > > > this behaviour is vital for me... i need to be able to have
> > > at least N
> > > > paths that are mounted to a single class and can then be
> > > switched by
> > > > the first request param.
> > > >
> > > > Best Regards
> > > >
> > > > Korbinian
> > > >
> > > >
> > > >
> > > >
> > >
> >
> >
> 


Re: wicket2 / multi-mounts to class

Posted by Johan Compagner <jc...@gmail.com>.
no you didn't understand it.

If you don't have exactly the same parameter in this call:

mount("/de",new IndexedParamUrlCodingStrategy("/de",Katalog.class));

So if it was this:

mount("/en",new IndexedParamUrlCodingStrategy("/de",Katalog.class));

Then it doesn't work. The request target will generate an url that will
start with "/de"
but incomming request that now have a path "/de/xxxx" don't match with the
"/en"  key where the strategy is mapped on. So it does't match.


So i your case it is very strange that it works (as you say i haven't tested
it)
because you do this:

mount("/en",new IndexedParamUrlCodingStrategy("",Katalog.class));

then the coding strategy makes urls without the /en mount
like /ParamA/ParamB

then the url comes back in
but /ParamA/ParamB doesn't start with "/en" so it doesn't map on your coding
strategy.
So who is decoding it??

It just has to be in sync. So thats why i removed that param in the mount.
It doesn't make any sense that it is not in sync.

johan



On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
>
> it did.  you just didnt understand it yet -
>
> in wicket 1.x you can mount a page to
>
> /de
> /en
> and not having the IndexedPar...egy putting the /de everytime in front -
> but
> you were responsible for that by having the 0 param beeing set to e.g: de
> .
> A nice URL paradigm begins by creating it on paper and by putting out
> everything you dont want - and even if you prefer component or not, its a
> missioncritical thing nowadays for public websites (security, spiders
> etc.)
>
> e.g: having only 1 (!) active mount in wicket 2.0 like now destroys this
> completely, what in wicket 1.x worked
>
> imagine you have a big business site, and the paradigm tells you to order
> the language by var URL paradigms, whereas /en and /de are new and
> reworked
> by using wicket, while /cn and /ar are old ones managed by other
> systems...
> or a shop that has to show prices for various countries in various
> languages
> you need to put it anywhere to, when the page should be bookmarkable and
> nice
>
> so we have 2 paradigms:
>
> - /page/lang/params
> - /lang/params
>
> wich one is nicer ? the second, as it allows you to be as flexible as you
> want and this was what i like in wicket 1.x - you were free to do what you
> want, not forced to develop your own thing if you need it...
>
> in wicket 1.x you can just use the
> mount("/de/", new IndexedParamUrlCodingStrategy("",Katalog.class));
> telling him he has pages mounted unter "/de/" and they should use a
> IndexedParam without any special thing to it, while in wicket 2 this has
> been stripped and now forces us to have a CodingStrategy that relies on
> other things
>
> you also cant then easily upgrade older URLCodingStrategies as mount no
> longer can be used to mount a path and a strategy but only the strategy
> alone...
>
> i understand most changes in wicket2, as they have more pros then cons,
> but
> this one has only cons as i dont see any advancement but lost
> base-functionality
>
> Regards
>
> Korbinian
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Johan Compagner [mailto:jcompagner@gmail.com]
> > Gesendet: Mittwoch, 15. November 2006 16:35
> > An: wicket-dev@incubator.apache.org
> > Betreff: Re: wicket2 / multi-mounts to class
> >
> > the param didn't make any sense because the first param was
> > only used to put in in a map and the string you put into the
> > strategy is used in the decode and encode so having 2 params
> > which are not the same don't make any sense. Because the urls
> > generated then don't really map anymore on the param that is
> > in the map.
> >
> > So what does the first param of mount in wicket 1.x really mean?
> >
> > why not just do one mount:
> >
> > mount(new IndexedParamUrlCodingStrategy("/global",Katalog.class));
> >
> > and then do anything you want after that??
> >
> > /global/x
> > /global/y
> > /global/z
> >
> > all go to one class, that is one mount.
> >
> > johan
> >
> >
> >
> > On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> > >
> > > Hi,
> > >
> > > in wicket 1.x you can do following:
> > >
> > > mount("/de/", new IndexedParamUrlCodingStrategy("",Katalog.class));
> > > mount("/en/", new IndexedParamUrlCodingStrategy("",Katalog.class));
> > >
> > > while in wicket 2.0 you only can do:
> > >
> > > mount(new IndexedParamUrlCodingStrategy("/de",Katalog.class));
> > > mount(new IndexedParamUrlCodingStrategy("/en",Katalog.class));
> > >
> > > wich then means that you cant switch by the 0 - Param the path...
> > > meaning if you enter /IndexA/Foo/Bar you cant have a link to
> > > /IndexB/Foo/Bar by just using PageParams("0=Foo,1=Bar") (similar..)
> > >
> > > (the /de and /en here is the language for example)
> > >
> > >
> > > is there a way to do this? else i would make a Jira
> > featurerequest as
> > > this behaviour is vital for me... i need to be able to have
> > at least N
> > > paths that are mounted to a single class and can then be
> > switched by
> > > the first request param.
> > >
> > > Best Regards
> > >
> > > Korbinian
> > >
> > >
> > >
> > >
> >
>
>

AW: wicket2 / multi-mounts to class

Posted by Korbinian Bachl <ko...@whiskyworld.de>.
it did.  you just didnt understand it yet -

in wicket 1.x you can mount a page to 

/de
/en
and not having the IndexedPar...egy putting the /de everytime in front - but
you were responsible for that by having the 0 param beeing set to e.g: de .
A nice URL paradigm begins by creating it on paper and by putting out
everything you dont want - and even if you prefer component or not, its a
missioncritical thing nowadays for public websites (security, spiders etc.)

e.g: having only 1 (!) active mount in wicket 2.0 like now destroys this
completely, what in wicket 1.x worked

imagine you have a big business site, and the paradigm tells you to order
the language by var URL paradigms, whereas /en and /de are new and reworked
by using wicket, while /cn and /ar are old ones managed by other systems...
or a shop that has to show prices for various countries in various languages
you need to put it anywhere to, when the page should be bookmarkable and
nice

so we have 2 paradigms:

- /page/lang/params
- /lang/params

wich one is nicer ? the second, as it allows you to be as flexible as you
want and this was what i like in wicket 1.x - you were free to do what you
want, not forced to develop your own thing if you need it...

in wicket 1.x you can just use the 
mount("/de/", new IndexedParamUrlCodingStrategy("",Katalog.class));
telling him he has pages mounted unter "/de/" and they should use a
IndexedParam without any special thing to it, while in wicket 2 this has
been stripped and now forces us to have a CodingStrategy that relies on
other things

you also cant then easily upgrade older URLCodingStrategies as mount no
longer can be used to mount a path and a strategy but only the strategy
alone...

i understand most changes in wicket2, as they have more pros then cons, but
this one has only cons as i dont see any advancement but lost
base-functionality

Regards

Korbinian



> -----Ursprüngliche Nachricht-----
> Von: Johan Compagner [mailto:jcompagner@gmail.com] 
> Gesendet: Mittwoch, 15. November 2006 16:35
> An: wicket-dev@incubator.apache.org
> Betreff: Re: wicket2 / multi-mounts to class
> 
> the param didn't make any sense because the first param was 
> only used to put in in a map and the string you put into the 
> strategy is used in the decode and encode so having 2 params 
> which are not the same don't make any sense. Because the urls 
> generated then don't really map anymore on the param that is 
> in the map.
> 
> So what does the first param of mount in wicket 1.x really mean?
> 
> why not just do one mount:
> 
> mount(new IndexedParamUrlCodingStrategy("/global",Katalog.class));
> 
> and then do anything you want after that??
> 
> /global/x
> /global/y
> /global/z
> 
> all go to one class, that is one mount.
> 
> johan
> 
> 
> 
> On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> >
> > Hi,
> >
> > in wicket 1.x you can do following:
> >
> > mount("/de/", new IndexedParamUrlCodingStrategy("",Katalog.class));
> > mount("/en/", new IndexedParamUrlCodingStrategy("",Katalog.class));
> >
> > while in wicket 2.0 you only can do:
> >
> > mount(new IndexedParamUrlCodingStrategy("/de",Katalog.class));
> > mount(new IndexedParamUrlCodingStrategy("/en",Katalog.class));
> >
> > wich then means that you cant switch by the 0 - Param the path... 
> > meaning if you enter /IndexA/Foo/Bar you cant have a link to 
> > /IndexB/Foo/Bar by just using PageParams("0=Foo,1=Bar") (similar..)
> >
> > (the /de and /en here is the language for example)
> >
> >
> > is there a way to do this? else i would make a Jira 
> featurerequest as 
> > this behaviour is vital for me... i need to be able to have 
> at least N 
> > paths that are mounted to a single class and can then be 
> switched by 
> > the first request param.
> >
> > Best Regards
> >
> > Korbinian
> >
> >
> >
> >
> 


Re: wicket2 / multi-mounts to class

Posted by Johan Compagner <jc...@gmail.com>.
the param didn't make any sense because the first param was only used to
put in in a map and the string you put into the strategy is used in the
decode and encode
so having 2 params which are not the same don't make any sense. Because the
urls generated
then don't really map anymore on the param that is in the map.

So what does the first param of mount in wicket 1.x really mean?

why not just do one mount:

mount(new IndexedParamUrlCodingStrategy("/global",Katalog.class));

and then do anything you want after that??

/global/x
/global/y
/global/z

all go to one class, that is one mount.

johan



On 11/15/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
>
> Hi,
>
> in wicket 1.x you can do following:
>
> mount("/de/", new IndexedParamUrlCodingStrategy("",Katalog.class));
> mount("/en/", new IndexedParamUrlCodingStrategy("",Katalog.class));
>
> while in wicket 2.0 you only can do:
>
> mount(new IndexedParamUrlCodingStrategy("/de",Katalog.class));
> mount(new IndexedParamUrlCodingStrategy("/en",Katalog.class));
>
> wich then means that you cant switch by the 0 - Param the path... meaning
> if
> you enter /IndexA/Foo/Bar you cant have a link to /IndexB/Foo/Bar by just
> using PageParams("0=Foo,1=Bar") (similar..)
>
> (the /de and /en here is the language for example)
>
>
> is there a way to do this? else i would make a Jira featurerequest as this
> behaviour is vital for me... i need to be able to have at least N paths
> that
> are mounted to a single class and can then be switched by the first
> request
> param.
>
> Best Regards
>
> Korbinian
>
>
>
>