943,621 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 462
  • Java RSS
Aug 20th, 2009
0

login help plz

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
beanboy is offline Offline
44 posts
since Aug 2009
Aug 20th, 2009
0

Re: login help plz

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.
Quote ...
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.
Last edited by stephen84s; Aug 20th, 2009 at 3:50 am.
Featured Poster
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
stephen84s is offline Offline
1,316 posts
since Jul 2007
Aug 20th, 2009
0

Re: login help plz

Click to Expand / Collapse  Quote originally posted by stephen84s ...
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
Reputation Points: 10
Solved Threads: 1
Light Poster
beanboy is offline Offline
44 posts
since Aug 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: how to delete the previous contents in the file
Next Thread in Java Forum Timeline: silly doubt





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC