@ModelAttribute
public void userLoad(Model model) {
if (!model.containsAttribute("userBean")) {
UserDetails userDetails = null;
try {
userDetails = (UserDetails) ((SecurityContext) SecurityContextHolder.getContext()).getAuthentication().getPrincipal();
if (authenticationType.isLoadUserSpeedUp()) {
String xmlUsers = ConfManager.getConfString(userDetails.getAccount() + "-security/users.xml");
String xmlArchives = ConfManager.getConfString(userDetails.getAccount() + "-security/accounts.xml");
String xmlrole = ConfManager.getConfString(userDetails.getAccount() + "-security/role.xml");
UserBean userBean = LoadUserSpeedUp.loadUserByString(xmlUsers, xmlArchives, xmlrole, userDetails.getId(), userDetails.getAccount());
model.addAttribute("userBean", userBean);
} else {
XMLBuilder xmlUsers = ConfManager.getConfXML(userDetails.getAccount() + "-security/users.xml");
XMLBuilder xmlArchives = ConfManager.getConfXML(userDetails.getAccount() + "-security/accounts.xml");
XMLBuilder xmlrole = ConfManager.getConfXML(userDetails.getAccount() + "-security/role.xml");
UserBean userBean = LoadUser.loadUser(xmlUsers, xmlArchives, xmlrole, userDetails.getId(), userDetails.getAccount());
model.addAttribute("userBean", userBean);
}
} catch (Exception e) {
}