I know that It is possible to set navigation-rules in the faces-config.xml File. But there, I know only the option to do the Navigation in a correct Flow.
But I want to avoid that a user that isn't logged in can directly go to the home screen when he types the URL in the adressbar. Is it possible to do this in the config File or do I have to write a Frontcontroller as a class?
My Code:
<navigation-rule>
<from-view-id>/login.xhtml</from-view-id>
<navigation-case>
<from-outcome>register</from-outcome>
<to-view-id>/register.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>succes</from-outcome>
<to-view-id>/home.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>fail</from-outcome>
<to-view-id>/login.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
Hope you can help me.