vinod
vinod

Reputation: 1202

Use of servletcontext?

I created one web application so i want to store my past logged user name list for comparing new users which are going to login. so how i do that by using ServletContext ? or is there any other way?

Upvotes: 4

Views: 933

Answers (1)

BalusC
BalusC

Reputation: 1109745

In JSF, application scoped managed beans are stored in the servletcontext. So, you could basically just create and declare an application scoped managed bean and put the list in there.

However, there are probably better ways for the particular functional requirement which is yet unclear in the question. At least, implementing a HttpSessionListener or HttpSessionBindingListener is probably a better idea since logins are usually coupled to the HttpSession.

Here are several examples:

Upvotes: 2

Related Questions