我在我的jsf应用程序中使用facelets进行模板设计。我想在ui:composition标签中根据条件包含一个模板文件。如果用户已经登录,那么模板必须是“authorized.xhtml”,如果用户没有登录,则模板必须是“unauthorized.xhtml”。是否有一种方法可以实现这个功能?谢谢。
<ui:composition template="/templates/unauthorized.xhtml">
<ui:composition template="/templates/authorized.xhtml">
我正在使用JSF 1.2。