In web.XWikiServletURLFactory#init, the first path of the URL (wrongly name servletPath) is initialized with ServletContext().getServletContextName(), which should be used for the application name displayed in a container management application, and not as part of the URL. The proper value is request.getContextPath(), which is automatically set to reflect the application location.
This will allow:
- Easy changing the application directory and context name; right now, the displayName property in web.xml must be changed, too
- Use a proper display name to reflect the application contents (XWiki Enterprise, XWiki Watch, Chronopolys, etc)