Creating a session in jsf...

G

gbattine

Hi guys,
i've a question for you. I'm developing a jsf application.
I need to store data inserted in login by user into a session,to
retrieve them in other pages and to delete them when user log out.
How can i do it?
I've read about this problem and i've understood there are 2
possibilities,using servlet and directly JSF.
1) What is good and bad in these 2 possibilities?
2) i've a function login,i perform authentication and later i've tried
to create an user object with login attributes and to store it into a
session,but i'm not able to go on...

User user=new User();
user.setLogin(loginName);
user.setTeamname(teamName);
user.setLoggedIn(true);
Session session = (Session)
FacesContext.getCurrentInstance().getExternalContext().getSession(true);




can someone help me on how inserting user object into session?
Once i've done it,if a user try in the same time to log in with same
values,how can i test if a user with its data is yet navigating in the
application?
Thanks very much
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,951
Messages
2,570,113
Members
46,698
Latest member
alexxx

Latest Threads

Top