0
我想用JSF創建一個登錄表單,該表單還在外部上下文中創建一個新的UserPrincipal。如何創建新的UserPrincipal?
當我想在External FacesContext中創建一個新的UserPrincipal時,我該怎麼辦?
我使用WebSphere Application Server 8 JSF 2
我想要像這樣的工作:
FacesContext context = FacesContext.getCurrentInstance();
Principal principal = context.getExternalContext().getUserPrincipal();
問候 Veote
UserPrincipal是託管bean還是模型bean?另外,你使用的是什麼JSF版本? –
我編輯了我的帖子 – veote
@Luiggi:它是容器管理安全的一部分http://docs.oracle.com/javaee/6/tutorial/doc/gkbaa.html – BalusC