I am developing a complete j2ee application for students registration. i am storing the students & instructors with name & password using beans. When the user log in, I should be able to identify if the logged in user is an object of instrcutor-bean or student-bean. Then accordngly, I should prints the details of that user.
I am not able to identify the user object (instructor or student), with the user name.
Can anyone please help me?
Thanks,
Ketaki.
-
how to get the object or type of user once the user logs in? (8 messages)
- Posted by: ketaki joshi
- Posted on: October 31 2004 13:49 EST
Threaded Messages (8)
- how to get the object or type of user once the user logs in? by Ian Purton on November 01 2004 07:46 EST
- how to get the object or type of user once the user logs in? by Udayan Patel on November 01 2004 11:39 EST
- how to get the object or type of user once the user logs in? by Kambiz Kermanizadeh on November 01 2004 13:37 EST
- how to get the object or type of user once the user logs in? by Padmanabh Kulkarni on November 01 2004 14:20 EST
- how to get the object or type of user once the user logs in? by null on November 02 2004 06:45 EST
- how to get the object or type of user once the user logs in? by Padmanabh Kulkarni on November 01 2004 14:20 EST
- have usertype column in ur Db by surindhar kc on November 02 2004 07:32 EST
- Using a framework would greatly reduce the complexity by Anthony Randazzo on November 04 2004 20:43 EST
- Separate table and 1 query at login by Nitesh Ambastha on November 05 2004 09:44 EST
-
how to get the object or type of user once the user logs in?[ Go to top ]
- Posted by: Ian Purton
- Posted on: November 01 2004 07:46 EST
- in response to ketaki joshi
I am developing a complete j2ee application for students registration. i am storing the students & instructors with name & password using beans. When the user log in, I should be able to identify if the logged in user is an object of instrcutor-bean or student-bean. Then accordngly, I should prints the details of that user.I am not able to identify the user object (instructor or student), with the user name.Can anyone please help me?Thanks,Ketaki.
If you are unable to identify the type of user from the username then you will probably need the user to select on logon wether they are a student or instructor.
Ian Purton
Website Uptime and Availability | Permission Email List Management | Smartphone GPS | All Time Top 100 Rock Charts -
how to get the object or type of user once the user logs in?[ Go to top ]
- Posted by: Udayan Patel
- Posted on: November 01 2004 11:39 EST
- in response to ketaki joshi
I think your design is wrong. regardless of their type they both are type of user. Its just their roles are different. -
how to get the object or type of user once the user logs in?[ Go to top ]
- Posted by: Kambiz Kermanizadeh
- Posted on: November 01 2004 13:37 EST
- in response to ketaki joshi
If a user can login as a student or an instructor, you need to let them to select what type the user they are.
But if a user can login “only and only with one role”, as a student or instructor, you need to set the user “Role” to “Student” or “Instructor”. -
how to get the object or type of user once the user logs in?[ Go to top ]
- Posted by: Padmanabh Kulkarni
- Posted on: November 01 2004 14:20 EST
- in response to Kambiz Kermanizadeh
It all depends on how a particular user has registered (as a Student or Instructor). So based on the username you can query the DB to find out who actually logged in. If at registration the user doesn't specify what is the role then that becomes a Design issue. -
how to get the object or type of user once the user logs in?[ Go to top ]
- Posted by: null
- Posted on: November 02 2004 06:45 EST
- in response to Padmanabh Kulkarni
Typically, with multi-role systems, there are few restrictions placed on usernames/userIDs, which then allow the system to identify the user's role. Examples are university systems where the userID has a certain format, and so on.
Another mechanism is to provide different paths for different user types - say, a web-logon for one type of users, while application clients access via a custom protocol (of course over HTTPS/SSH) and pass on a public/private key.
Hence, for your application, you need to figure out a mechanism for defining the login-process and/or defining user-IDs -
have usertype column in ur Db[ Go to top ]
- Posted by: surindhar kc
- Posted on: November 02 2004 07:32 EST
- in response to ketaki joshi
Include usertype (Student or Teacher) column in your user table. -
Using a framework would greatly reduce the complexity[ Go to top ]
- Posted by: Anthony Randazzo
- Posted on: November 04 2004 20:43 EST
- in response to ketaki joshi
Using something like Turbine which has a built in user, group, role, and permissions concept, you'll easily be able to provide such a service. With that said. When the user is created you'll need an extra field to indicate the role. -
Separate table and 1 query at login[ Go to top ]
- Posted by: Nitesh Ambastha
- Posted on: November 05 2004 09:44 EST
- in response to ketaki joshi
Create a separate table for user-role mapping (to avoid future problems). After login, take "username" and query this table for 'role' - instructor or student.