Since 3.5, the ERROR dispatcher is assigned to the main Magnolia filter by default. If that's the case in your setup too, the 404 page in your web.xml needs to be reachable through Magnolia. Typically, you could have this in your web.xml:
.. and upon request of an unexisting resource, Magnolia would serve your /error/404 page.
Now, as far as I can tell, there is no other way than mapping all error codes in web.xml - we could do so by default, and a have location like /.magnolia/error which would take care, based on some configuration, render the configured page for the different codes, but
- is it really worth it ? i.e how much configuration will one be ready to do when it can be done directly in web.xml ? - (if there was a way to map "all" error codes to locations, I'd love it but as far as i can tell you have to map each and every error code separately)
- as far as I can tell, when serving an error page, you can't really know what the error code and message were (unless i've missed the obvious)
Any suggestion ?
Since 3.5, the ERROR dispatcher is assigned to the main Magnolia filter by default. If that's the case in your setup too, the 404 page in your web.xml needs to be reachable through Magnolia. Typically, you could have this in your web.xml:
<error-page> <error-code>404</error-code> <location>/errors/404.html</location> </error-page>Now, as far as I can tell, there is no other way than mapping all error codes in web.xml - we could do so by default, and a have location like /.magnolia/error which would take care, based on some configuration, render the configured page for the different codes, but
Any suggestion ?
<error-page> <error-code>404</error-code> <location>/errors/404.html</location> </error-page>- is it really worth it ? i.e how much configuration will one be ready to do when it can be done directly in web.xml ? - (if there was a way to map "all" error codes to locations, I'd love it but as far as i can tell you have to map each and every error code separately)
- as far as I can tell, when serving an error page, you can't really know what the error code and message were (unless i've missed the obvious)
Any suggestion ?