954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

login help plz

hi helper,

i'm trying userlogin web app....where logged in user ID's are sent to a hash map .....so that admin can view logged in users list...

my problem is... hash map is creating new map (which replaces the old map) when ever a user logs in.... so admin is able to view only last logged in user.........

is it possible to do with out a db.....? i think it is...

it will be so confusing 4 u if i put my code here....
plz gimme an idea of how to implement that (in detail if possible)

thanks in advance
BeanBoy

beanboy
Light Poster
44 posts since Aug 2009
Reputation Points: 10
Solved Threads: 1
 

Although you have mentioned that you are working on a web application, you have not even given us the slightest hint as to what are you using in that web application, is it JSP, Servlets etc.
is it possible to do with out a db.....? i think it is...
Yes its perfectly possible, although restricted to the list of users logged in since the last time your web application was reloaded or your web server restarted, if you want it to persist even across that, then its got to be a DB or a File to store that info.

In the former if using a JSP,you want your HashMap object to be visible across multiple sessions it will have to be in the "Application" scope.
Alternatively if you are using servlets, you could have your HashMap initialised in the init() method of your Servlet, and then just keep adding the list of Users logging in, in your corresponding service() or doGet() or doPost() method whichever you are using.

stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154
 
Although you have mentioned that you are working on a web applic.........the list of Users logging in, in your corresponding service() or doGet() or doPost() method whichever you are using.

thanQ vry much

beanboy
Light Poster
44 posts since Aug 2009
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You