我的應用程序已經使用JSF2,primefaces春季 發展我想就上述頁面添加用戶的詳細信息吧春季安全用戶詳細信息
這條將包含字符串Hello用戶, 這條只有當用戶出現登錄
我的問題是,當訪問的應用程序,我再次看到了吧,同時記錄的過程中不執行
有什麼建議?
組欄可見的代碼是:
public String login() {
boolean success = authenticationService.login(mail, password);
if (success) {
signedIn = true;
User user = (User) SecurityContextHolder.getContext()
.getAuthentication().getPrincipal();
String name = user.getUsername(); // get logged in username
System.out.println(">>>>>>>>> login "+name);
setName(name);
return "facultyRating"; // return to
// application
// but being
// logged now
} else {
signedIn = false;
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage("Login or password incorrect."));
return "/pages/securityLogin.xhtml/loginPage.xhtml";
}
這種方法在bean的存在,其中JSF2頁面「包含用戶信息欄」從中讀取 感謝
您可以張貼在那裏你將用戶欄的代碼? –
我編輯了這篇文章請看看 – user3351364