wicket-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject A placeholder for header items in page's markup
Date Fri, 19 Apr 2013 12:51:38 GMT

There were questions in the mailing lists about how to control the order of
header contributions.
In Wicket 6 there are PriorityHeaderItems
and org.apache.wicket.settings.IResourceSettings#getHeaderItemComparator()
but still this requires some great gymnastics to achieve a goal like making
sure that <meta> for charset is always at the very top of <head> content.

What do you think about the following suggestion:


  [some optional markup]
  [some more optional markup]

That is, <wicket:header-items/> acts as a placeholder, something like
org.apache.wicket.markup.head.filter.HeaderResponseContainer, that is used
to put all header contributions from Java or <wicket:head> in panels.

This gives the developer the flexibility to put something that is at the
top of the page's markup.
While rendering Wicket will put all header items in the placeholder. And
the developer can also add something that should always be at the bottom of

For backward compatibility, and sane default, if there is no
<wicket:header-items/> then everything is like it is today.


  <meta chartset="UTF-8"/>
  <script src="my-monkey-patch-of-wicket-ajax.js"></script>

Martin Grigorov
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message