Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Bookmarkable vs non-bookmarkable pages

Pages can be constructed with any constructor when they are being used in a Wicket session, but if you wish to link to a Page using a URL that is "bookmarkable" (which implies that the URL will not have any session information encoded in it, and that you can call this page directly without having a session first directly from your browser), you need to implement your Page with a no-arg constructor or with a constructor that accepts a PageParameters argument (which wraps any query string parameters for a request). In case the page has both constructors, the constructor with PageParameters will be used.

...

A recommended approach is that bookmarkable pages do nothing in their default behaviour (construction time) that can harm you (like deleting records etc), and that everything you want to hide, should be either put in protected pages, or in handlers such as links and forms on the pages. Note that those handlers are protected too, as they can never be called directly without having created the page instance first.

Linking to pages can be done in multiple ways:

...