My fix stops there.

The rest of the commit is the difference between the xwiki 5.0-milestone 2 jetty package and the trunk.