I am working on my index page and I am setting the side bars based on three
types of people that will be on it:
1) A normal user who userType is null, as they will never have the option to
view or change it
2)An admin user who userType is set to a string "Admin"
3) Any viewer who will be able to see basic information..  

However i am getting a line not available error, saying there is a null
pointer on the object? 

Code:

public boolean adminUser() {
                /*if(!user.getUserType().equalsIgnoreCase("Admin")) {
                                adminUser = false;
                        }
                        else*/ if(user.getUserType().equalsIgnoreCase("Admin")) 
{
                                adminUser = true;
                                setAdminUser(true);
                        }
                return adminUser;
        }       

        public boolean getAdminUser() {
                return adminUser;
        }

        public void setAdminUser(boolean adminUser) {
                this.adminUser = adminUser;
        }

        public Object onSubmitFromLogin() throws Exception {
                createDb();             
                if (validUser()) {
                        adminUser();
                        return index;                   
                }
                else {
                        login.recordError("Invalid Login");
                        return loginPage;
                }
        }

In the tml i just use the  statements to determine between the different
types..

Any ideas as how to get around this?


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Object-creator-set-to-null-tp4290653p4290653.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to