Wiki source code of Error Pages

Last modified by Eleni Cojocariu on 2026/11/25 14:46

Hide last authors
Eleni Cojocariu 6.1 1 The screen a reader gets when a page, an attachment or an entire wiki does not exist, or when access is denied, comes from a Velocity template: three of them are shipped with the web application, and the missing-page one with the [[Flamingo skin>>doc:extensions:Extension.Flamingo Skin]]. Each of the four looks for a wiki page of its own first and includes it when it exists, so the screen can be replaced without touching the skin. None of those four pages ships, which is why a new instance always shows the standard screen.
Eleni Cojocariu 3.1 2
Eleni Cojocariu 6.7 3 [[Customize an Error Page>>doc:documentation.xs.admin.page.error-pages.customize.WebHome]] gives the four page names, the wiki each one has to be created in, and the HTTP status of each case.
Eleni Cojocariu 3.1 4
5 == Why a wiki page rather than the template ==
6
Eleni Cojocariu 6.1 7 Editing the templates works, but they belong to two different artifacts (the missing-page one to the skin, the other three to the web application), so every upgrade brings new versions of them to merge. A wiki page is yours: an upgrade has nothing to merge into it.
Eleni Cojocariu 3.1 8
9 == What a custom page takes away ==
10
11 The template includes your page //instead of// its standard block, not in addition to it. On a missing page, that block is more than a message:
12
13 {{image reference="standard-missing-page.png" size="large" alt="The standard notice on a page that does not exist, with the create link and the suggestions of similar pages"/}}
14
Eleni Cojocariu 6.1 15 A custom ##XWiki.DocumentDoesNotExist## therefore also removes the "edit this page" link that lets a reader create the page, the suggestions of similar pages (contributed by a shipped user interface extension that hands the search over to the search engine, Solr on a standard instance), and the list of matching pages waiting in the recycle bin. The same holds for the other cases: a custom attachment page drops the extensions contributed to that screen, and a custom access-denied page drops both the underlying error and the distinction between "this wiki is read-only" and "you are not allowed". Whatever of that your readers need, your page has to offer itself.
Eleni Cojocariu 3.1 16
17 == One page for two situations ==
18
19 ##XWiki.DocumentDoesNotExist## answers both the reader who opens a page that does not exist and the far rarer case of a Velocity template that cannot be evaluated. The second is an internal error rather than a missing page, so a message written only for readers looking for content reads oddly there.

Get Connected