Well this is my code
package Entities;
public class Users {
String user_name;
String user_type;
public void setName(String un, String type) {
user_name = un;
user_type = type;
}
public String getName(){
return user_name;
}
public String getType(){
return user_type;
}
}
Actually this a basic thing and sorry for asking you guys..In my login interface I set username and user Type
Entities.Users eu = new Entities.Users();
eu.setName(un, unType);
Then somewhere else in home page I want this username and user type and I call getter like this
Entities.Users eu = new Entities.Users();
System.out.println(eu.getName());
System.out.println(eu.getType());
But it always return NULL !!!!!! Why is that..
eu.setName(un, unType);witheu.setName(un, unType);user_namewill benullas in, not assigned anything. Carry the instance through the session, request, or whatever the scope.Entities.Users eu = new Entities.Users()that doesn't have the values set