Templates 使用jsf为每种类型的用户提供菜单
我试图在我的网页中使用的模板中包含一个菜单,问题是我的菜单会根据连接的用户类型而变化。哦,我正在使用jsf。 所以页面->模板->菜单 在第一个页面login.xhtml中,一个按钮将用户带到bean:Templates 使用jsf为每种类型的用户提供菜单,templates,jsf,menu,javabeans,Templates,Jsf,Menu,Javabeans,我试图在我的网页中使用的模板中包含一个菜单,问题是我的菜单会根据连接的用户类型而变化。哦,我正在使用jsf。 所以页面->模板->菜单 在第一个页面login.xhtml中,一个按钮将用户带到bean: <p:commandButton id="logins" value="login" action="#{UtilisateurBean.connection_role}" update="growl"/> 在我的模板中,我将: 现在,当我点击登录按钮时,该页面将不在任何地
<p:commandButton id="logins" value="login" action="#{UtilisateurBean.connection_role}" update="growl"/>
在我的模板中,我将:
现在,当我点击登录按钮时,该页面将不在任何地方,用户已连接,我已使用一些println进行了检查,但没有调用任何其他页面
注:如果我替换
使用
它工作得很好,如果你把
包装得很好,新页面就会显示出来,,但是没有注意到它的插入而不是包含。。。无论如何,它应该看到包装面板组。。。这一切都会在aame页面中结束
public String connection_role() {
Utilisateur authentifi = resp.seConnecter_role(login, password, typeRole);
FacesMessage msg;
FacesContext myFacesContext;
if ("_".equals(authentifi.getLogin())) {
msg = new FacesMessage("Compte incorrect", "Login password incorrect");
msg.setSeverity(FacesMessage.SEVERITY_INFO);
myFacesContext = FacesContext.getCurrentInstance();
myFacesContext.addMessage(null, msg);
return null;
} else if (authentifi != null) {
Utilisateur user = resp.findById(idutilisateur);
HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
if (typeRole.equals("Administrateur")) {
cleanForm();
setMenu("menuAdministrateur.html");
session.setAttribute("user", user);
return "listItem.xhtml";
} else if (typeRole.equals("Administrateur Audit")) {
cleanForm();
setMenu("menuAdministrateurAudit.html");
session.setAttribute("user", user);
return "Administrateur_Audit";
} else if (typeRole.equals("Planificateur")) {
cleanForm();
setMenu("menuPlanificateur.html");
session.setAttribute("user", user);
return "Planificateur";
} else {
cleanForm();
setMenu("menuAuditeur.html");
session.setAttribute("user", user);
return "Auditeur";
}
}
return null;
}