Page Welcome (index.xhtml dans la racine des pages Web) :
<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <title>TP sécurité</title> </h:head> <h:body> Page "Welcome". <h:outputLink value="faces/protected/index.xhtml">Page protégée</h:outputLink> <h:form> <h:commandLink action="protected/index.xhtml" value="Page protégée, par commandLink" /> <h:link outcome="protected/index.xhtml" value="Page protégée, par link" /> </h:form> </h:body> </html>Il est tout à fait possible d'accéder à la page "protégée" par le lien ajouté (<h:commandLink>) car ce lien est traduit par un forward interne au serveur, pour lequel les contraintes de sécurité ne sont pas déclenchées car l'URL ne correspond pas aux patterns protégés.