-1
我正在开发一个JSF项目,它有一个login.xhtml
文件,用户通过他的角色登录并转到其他页面。在JSF文件中控制访问
其实,我有四个角色:
- 管理员
- 计数器
- 客户
- 出纳
相关四个网页:
- indexAdministrator.xhtml
- indexCounter.xhtml
- indexClient.xhtml
- indexCashier.xhtml
那工作还好吧,但问题是当用户未登录。直接从URL进入page.xhtml
,它会进入,我只需要授权的用户即可。
如果它的东西,我在HttpSession中两个参数:
session.setAttribute("currentUser", currentUser);
session.setAttribute("role", role);
谢谢你的男人,我这样做,然后它的工作:) – Creativelair 2012-03-19 07:41:54