Principal Tag Not Working As Expected

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Principal Tag Not Working As Expected

Using Tomcat 8.5.23  I am able to login/logout and user other tags
(hasPersmission, etc.) without any issue.


Works as expected:
Hello, <shiro:principal/>, how are you today?

Returns Hello,, how are you today? I have even tried type="User" with the
same result (w/o type it crashes):
Hello, <shiro:principal type="com.test.User" property="firstName"/> , how
are you today? -

User Class:
public class User implements Serializable {
    private int userId;
    private String firstName;
    private String lastName;
    private String userName;
    private String emailAddress;
    private String password;
    private String department;
    private String role;

    public User(){


    public int getUserId() {
        return userId;

    public void setUserId(int userId) {
        this.userId = userId;

    public String getFirstName() {
        return firstName;

    public void setFirstName(String firstName) {
        this.firstName = firstName;

    public String getLastName() {
        return lastName;

    public void setLastName(String lastName) {
        this.lastName = lastName;

    public String getUserName() {
        return userName;

    public void setUserName(String userName) {
        this.userName = userName;

    public String getEmailAddress() {
        return emailAddress;

    public void setEmailAddress(String emailAddress) {
        this.emailAddress = emailAddress;

    public String getPassword() {
        return password;

    public void setPassword(String password) {
        this.password = password;

    public String getDepartment() {
        return department;

    public void setDepartment(String department) {
        this.department = department;

    public String getRole() {
        return role;

    public void setRole(String role) {
        this.role = role;

I have looked throughout Google and SO without any success. Any help would
be appreciated.

Sent from: