[英]How to store currently logged on user in DB?
使用Seam 2.1.2和JSF 1.2,我想知道如何在數據庫中存儲用戶登錄名。
在普通的JSF中,我只需查找FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
在支持bean中,並將值設置為持久對象。
如何實現將用戶名存儲在數據庫中?
您可以注入憑據組件
private @In Credentials credentials;
因此,通過使用檢索您的登錄用戶
credentials.getUsername();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.