2

After migration from wicket 1.4 to wicket 1.5 I can see a new behaviour concerning web URLs. Every pages has ?[0-9]+ added to it for example http://mywickethomepage.com/?0 , http://mywickethomepage.com/?3 .

My question is: what actually it is? Googling just gave me a hint that's an id for stateful page, right? Question number two, is there (an easy) way to hide/remove it as it makes my page urls ugly?

kamil
  • 3,482
  • 1
  • 40
  • 64
  • I have learned in another comment here on SO that this is the same behaviour as in 1.4 with the HybridURLCodungStrategie. It is for referencing a page in the page historie. You can work without this versioning of you page is stateless. – bert Nov 15 '11 at 11:56
  • 2
    See this related question [http://stackoverflow.com/questions/8081143/components-not-reloading-on-url-change-in-wicket-1-5-2](http://stackoverflow.com/questions/8081143/components-not-reloading-on-url-change-in-wicket-1-5-2) – rotsch Nov 15 '11 at 12:18
  • Indeed the question is related, although the guy there didn't get straight answer for my question... but I guess that the only way is change page into stateless one? – kamil Nov 15 '11 at 13:01

1 Answers1

1

This is the page id for stateful pages. A stateful page is instantiated just once and then with each request to it Wicket will load it from the disk and reuse it. Wicket 1.4 behaved the same way with its special wicket:interface parameter. Only Hybrid(Indexed)UrlCodingStrategy worked like MountedMapper in Wicket 1.4.

Even this is the default behavior it is not necessary the mandatory. You can implement your own IRequestMapper that encodes/decodes the Url as you wish. See http://wicketinaction.com/2011/07/wicket-1-5-request-mapper/ for more information.

martin-g
  • 17,243
  • 2
  • 23
  • 35