title: How to restrict access if user is not logged in
body: <p>My project has a template <code>main.xhtml</code> and three views <code>login.xhtml</code>, <code>dashboard.xhtml</code>, <code>new.xhtml</code>. Once I login in <code>login.xhtml</code>, the <code>LoginBean</code> will validate and if successful, then it will take to <code>dashboard.xhtml</code>. If user need to create an new record he click the new button which takes to <code>new.xhtml</code>.</p>
  
  <p>But the problem is, if <code>dashboard.xhtml</code> is requested directly from browser, then it is working without login. Do I need to check every view that the user is logged in? How can I achieve this?</p>