hello I successfully get the logged in username value from servelt into JSP page as below:
Welcome:${loginedUser.userName}
I need to use this username in If condition in JSP page to compare with another value like for example:
<%if(tc.getTEAssigned().equalsIgnoreCase(${loginedUser.userName}) %>
set Attribute:
// Store user info in Session.
public static void storeLoginedUser(HttpSession session, UserAccount loginedUser) {
// On the JSP can access via ${loginedUser}
session.setAttribute("loginedUser", loginedUser);
}
UserAccount contains those values:
private String userName;
private String gender;
private String password;
private List<String> roles;
i tried to use
<%=session.getAttribute("loginedUser") %>
but it result is
com.jdbc.UserAccount@2990e7ee
so my question is how to use ${loginedUser.userName} value in If conditions