I develop a web application on Apache Tomcat (Version 7) using JSF2. End users will probably fidget around with the address bar of a web application. I want to impose a default behavior on cases when users either call for a subpage that does not exist (which normally leads to a Tomcat file-not-found page ("The requested resource () is not available."
) or call the application without specifying a startpage (like http://localhost:8080/App/
). My desired behavior would be to redirect the user to a custom page with more telling information than a default server error message.
I have not figured out an available link between my JSF application and Tomcat. I tried to solve this problem using a Phase Listener, but it does not work - as no page associated with my application is requested. How to achieve this in the aforementioned technological environment?