Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Hi I have one web application and i want to get the number of users who are currently accessing the application. Also I want to get the user details of each user, which is stored in a database. How can I do this? Pls help. Getting No: and

Reply
Thread Tools

Hi I have one web application and i want to get the number of users who are currently accessing the application. Also I want to get the user details of each user, which is stored in a database. How can I do this? Pls help. Getting No: and

 
 
anu
Guest
Posts: n/a
 
      04-27-2005
Hi

I have one web application (Tomcat/Java/MySQL) and i want to get the
number of users who are currently accessing the application.

Also I want to get the user details of each user, which is stored in a
database.

How can I do this? Pls help.

Regards
Mary
 
Reply With Quote
 
 
 
 
tzvika.barenholz@gmail.com
Guest
Posts: n/a
 
      04-27-2005
I'm assuming you mean you want to show something to the user like:
"currently 27 users online!".
This is tricky. Some user who has sent a request for a page and is now
looking at it is not "online" in a computer sense, but he or she is
online in the human sense. They're on the site.

I would suggest you add some functionality to your login page that adds
to a list of online user objects. the logout page will remove from that
list.

 
Reply With Quote
 
 
 
 
Joona I Palaste
Guest
Posts: n/a
 
      04-27-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> scribbled the following:
> I'm assuming you mean you want to show something to the user like:
> "currently 27 users online!".
> This is tricky. Some user who has sent a request for a page and is now
> looking at it is not "online" in a computer sense, but he or she is
> online in the human sense. They're on the site.


> I would suggest you add some functionality to your login page that adds
> to a list of online user objects. the logout page will remove from that
> list.


To the OP:
But with this approach, if a user closes the browser without first
logging off, then goes to bed, goes on holiday, or accidentally drops
dead, your application will show him/her as online even though he/she
isn't viewing your page.
I'm afraid that because HTTP is connectionless, your problem is in the
general case unsolvable. You'll have to make do with some approximation,
such as counting users who have sent HTTP requests within the last 30
minutes.

--
/-- Joona Palaste ((E-Mail Removed)) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"Normal is what everyone else is, and you're not."
- Dr. Tolian Soran
 
Reply With Quote
 
Betty
Guest
Posts: n/a
 
      04-29-2005

"Joona I Palaste" <(E-Mail Removed)> wrote in message
news:d4oi73$rtk$(E-Mail Removed)...
> (E-Mail Removed) <(E-Mail Removed)> scribbled the

following:
> > I'm assuming you mean you want to show something to the user like:
> > "currently 27 users online!".
> > This is tricky. Some user who has sent a request for a page and is now
> > looking at it is not "online" in a computer sense, but he or she is
> > online in the human sense. They're on the site.

>
> > I would suggest you add some functionality to your login page that adds
> > to a list of online user objects. the logout page will remove from that
> > list.

>
> To the OP:
> But with this approach, if a user closes the browser without first
> logging off, then goes to bed, goes on holiday, or accidentally drops
> dead,


So dropping dead on purpose is ok?

> your application will show him/her as online even though he/she
> isn't viewing your page.
> I'm afraid that because HTTP is connectionless, your problem is in the
> general case unsolvable. You'll have to make do with some approximation,
> such as counting users who have sent HTTP requests within the last 30
> minutes.
>
> --
> /-- Joona Palaste ((E-Mail Removed)) ------------- Finland --------\
> \-------------------------------------------------------- rules! --------/
> "Normal is what everyone else is, and you're not."
> - Dr. Tolian Soran



 
Reply With Quote
 
Peter MacMillan
Guest
Posts: n/a
 
      04-29-2005
Betty wrote:
> "Joona I Palaste" <(E-Mail Removed)> wrote in message
> news:d4oi73$rtk$(E-Mail Removed)...
>>But with this approach, if a user closes the browser without first
>>logging off, then goes to bed, goes on holiday, or accidentally drops
>>dead,

>
>
> So dropping dead on purpose is ok?
>
>


Well, if you're going to drop dead on purpose you can at least have the
common courtesy to logoff first.

--
Peter MacMillan
e-mail/msn: (E-Mail Removed)
 
Reply With Quote
 
kjc
Guest
Posts: n/a
 
      04-29-2005
Joona I Palaste wrote:
> (E-Mail Removed) <(E-Mail Removed)> scribbled the following:
>
>>I'm assuming you mean you want to show something to the user like:
>>"currently 27 users online!".
>>This is tricky. Some user who has sent a request for a page and is now
>>looking at it is not "online" in a computer sense, but he or she is
>>online in the human sense. They're on the site.

>
>
>>I would suggest you add some functionality to your login page that adds
>>to a list of online user objects. the logout page will remove from that
>>list.

>
>
> To the OP:
> But with this approach, if a user closes the browser without first
> logging off, then goes to bed, goes on holiday, or accidentally drops
> dead, your application will show him/her as online even though he/she
> isn't viewing your page.
> I'm afraid that because HTTP is connectionless, your problem is in the
> general case unsolvable. You'll have to make do with some approximation,
> such as counting users who have sent HTTP requests within the last 30
> minutes.
>

Not true, if you use a SessionListener.
 
Reply With Quote
 
Joona I Palaste
Guest
Posts: n/a
 
      05-04-2005
kjc <(E-Mail Removed)> scribbled the following:
> Joona I Palaste wrote:
>> (E-Mail Removed) <(E-Mail Removed)> scribbled the following:
>>
>>>I'm assuming you mean you want to show something to the user like:
>>>"currently 27 users online!".
>>>This is tricky. Some user who has sent a request for a page and is now
>>>looking at it is not "online" in a computer sense, but he or she is
>>>online in the human sense. They're on the site.

>>
>>>I would suggest you add some functionality to your login page that adds
>>>to a list of online user objects. the logout page will remove from that
>>>list.

>>
>> To the OP:
>> But with this approach, if a user closes the browser without first
>> logging off, then goes to bed, goes on holiday, or accidentally drops
>> dead, your application will show him/her as online even though he/she
>> isn't viewing your page.
>> I'm afraid that because HTTP is connectionless, your problem is in the
>> general case unsolvable. You'll have to make do with some approximation,
>> such as counting users who have sent HTTP requests within the last 30
>> minutes.
>>

> Not true, if you use a SessionListener.


And how is using a SessionListener magically going to turn HTTP into a
connectionful protocol? The bottom line remains, the server is only ever
going to know when the user sends HTTP requests. It isn't going to know
what the user does when he/she *isn't* sending HTTP requests. He/she
might be looking at the page returned by the server, reading it over and
over again. OTOH, he/she could have closed the browser, gone to bed,
gone on holiday, or dropped dead. Your server isn't going to be any
wiser until it gets another HTTP request.
If looking at the page counts as "being on the site" but sleeping, or
being dead, doesn't, then the original problem remains unsolvable.
Either you run the risk of logging the user off while he/she's still
reading the pages, or the risk of keeping the user logged on when he/she
doesn't have anything to do with the page any more.

--
/-- Joona Palaste ((E-Mail Removed)) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"Holy Banana of this, Sacred Coconut of that, Magic Axolotl of the other."
- Guardian in "Jinxter"
 
Reply With Quote
 
kjc
Guest
Posts: n/a
 
      05-04-2005
Joona I Palaste wrote:
> kjc <(E-Mail Removed)> scribbled the following:
>
>>Joona I Palaste wrote:
>>
>>>(E-Mail Removed) <(E-Mail Removed)> scribbled the following:
>>>
>>>
>>>>I'm assuming you mean you want to show something to the user like:
>>>>"currently 27 users online!".
>>>>This is tricky. Some user who has sent a request for a page and is now
>>>>looking at it is not "online" in a computer sense, but he or she is
>>>>online in the human sense. They're on the site.
>>>
>>>>I would suggest you add some functionality to your login page that adds
>>>>to a list of online user objects. the logout page will remove from that
>>>>list.
>>>
>>>To the OP:
>>>But with this approach, if a user closes the browser without first
>>>logging off, then goes to bed, goes on holiday, or accidentally drops
>>>dead, your application will show him/her as online even though he/she
>>>isn't viewing your page.
>>>I'm afraid that because HTTP is connectionless, your problem is in the
>>>general case unsolvable. You'll have to make do with some approximation,
>>>such as counting users who have sent HTTP requests within the last 30
>>>minutes.
>>>

>>
>>Not true, if you use a SessionListener.

>
>
> And how is using a SessionListener magically going to turn HTTP into a
> connectionful protocol? The bottom line remains, the server is only ever
> going to know when the user sends HTTP requests. It isn't going to know
> what the user does when he/she *isn't* sending HTTP requests. He/she
> might be looking at the page returned by the server, reading it over and
> over again. OTOH, he/she could have closed the browser, gone to bed,
> gone on holiday, or dropped dead. Your server isn't going to be any
> wiser until it gets another HTTP request.
> If looking at the page counts as "being on the site" but sleeping, or
> being dead, doesn't, then the original problem remains unsolvable.
> Either you run the risk of logging the user off while he/she's still
> reading the pages, or the risk of keeping the user logged on when he/she
> doesn't have anything to do with the page any more.
>

The original poster referred to "Logging in"
If you login, you have a Session created.
In your web.xml you have a timeout value for a session.
If there isn't activity (navigation etc..) associated with a given
session in N amount of time, the session is invalidated, and is there
are SessionListeners registered, they will be notified.
Once notified, descrement a counter.
 
Reply With Quote
 
Joona I Palaste
Guest
Posts: n/a
 
      05-07-2005
kjc <(E-Mail Removed)> scribbled the following:
> Joona I Palaste wrote:
>> kjc <(E-Mail Removed)> scribbled the following:
>>>Joona I Palaste wrote:
>>>>(E-Mail Removed) <(E-Mail Removed)> scribbled the following:
>>>>>I'm assuming you mean you want to show something to the user like:
>>>>>"currently 27 users online!".
>>>>>This is tricky. Some user who has sent a request for a page and is now
>>>>>looking at it is not "online" in a computer sense, but he or she is
>>>>>online in the human sense. They're on the site.
>>>>
>>>>>I would suggest you add some functionality to your login page that adds
>>>>>to a list of online user objects. the logout page will remove from that
>>>>>list.
>>>>
>>>>To the OP:
>>>>But with this approach, if a user closes the browser without first
>>>>logging off, then goes to bed, goes on holiday, or accidentally drops
>>>>dead, your application will show him/her as online even though he/she
>>>>isn't viewing your page.
>>>>I'm afraid that because HTTP is connectionless, your problem is in the
>>>>general case unsolvable. You'll have to make do with some approximation,
>>>>such as counting users who have sent HTTP requests within the last 30
>>>>minutes.
>>>
>>>Not true, if you use a SessionListener.

>>
>> And how is using a SessionListener magically going to turn HTTP into a
>> connectionful protocol? The bottom line remains, the server is only ever
>> going to know when the user sends HTTP requests. It isn't going to know
>> what the user does when he/she *isn't* sending HTTP requests. He/she
>> might be looking at the page returned by the server, reading it over and
>> over again. OTOH, he/she could have closed the browser, gone to bed,
>> gone on holiday, or dropped dead. Your server isn't going to be any
>> wiser until it gets another HTTP request.
>> If looking at the page counts as "being on the site" but sleeping, or
>> being dead, doesn't, then the original problem remains unsolvable.
>> Either you run the risk of logging the user off while he/she's still
>> reading the pages, or the risk of keeping the user logged on when he/she
>> doesn't have anything to do with the page any more.
>>

> The original poster referred to "Logging in"
> If you login, you have a Session created.
> In your web.xml you have a timeout value for a session.
> If there isn't activity (navigation etc..) associated with a given
> session in N amount of time, the session is invalidated, and is there
> are SessionListeners registered, they will be notified.
> Once notified, descrement a counter.


A timeout value is inherently only an approximation. No matter what you
choose the timeout value as, there is no law forcing users to stop
looking at the site *exactly* when the timeout expires. Some of them
might stop sooner, some of them might stop later. Your server isn't
going to know for sure, it can only guess. This is what I've been saying
all along.

--
/-- Joona Palaste ((E-Mail Removed)) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"I am lying."
- Anon
 
Reply With Quote
 
kjc
Guest
Posts: n/a
 
      05-07-2005
Joona I Palaste wrote:
> kjc <(E-Mail Removed)> scribbled the following:
>
>>Joona I Palaste wrote:
>>
>>>kjc <(E-Mail Removed)> scribbled the following:
>>>
>>>>Joona I Palaste wrote:
>>>>
>>>>>(E-Mail Removed) <(E-Mail Removed)> scribbled the following:
>>>>>
>>>>>>I'm assuming you mean you want to show something to the user like:
>>>>>>"currently 27 users online!".
>>>>>>This is tricky. Some user who has sent a request for a page and is now
>>>>>>looking at it is not "online" in a computer sense, but he or she is
>>>>>>online in the human sense. They're on the site.
>>>>>
>>>>>>I would suggest you add some functionality to your login page that adds
>>>>>>to a list of online user objects. the logout page will remove from that
>>>>>>list.
>>>>>
>>>>>To the OP:
>>>>>But with this approach, if a user closes the browser without first
>>>>>logging off, then goes to bed, goes on holiday, or accidentally drops
>>>>>dead, your application will show him/her as online even though he/she
>>>>>isn't viewing your page.
>>>>>I'm afraid that because HTTP is connectionless, your problem is in the
>>>>>general case unsolvable. You'll have to make do with some approximation,
>>>>>such as counting users who have sent HTTP requests within the last 30
>>>>>minutes.
>>>>
>>>>Not true, if you use a SessionListener.
>>>
>>>And how is using a SessionListener magically going to turn HTTP into a
>>>connectionful protocol? The bottom line remains, the server is only ever
>>>going to know when the user sends HTTP requests. It isn't going to know
>>>what the user does when he/she *isn't* sending HTTP requests. He/she
>>>might be looking at the page returned by the server, reading it over and
>>>over again. OTOH, he/she could have closed the browser, gone to bed,
>>>gone on holiday, or dropped dead. Your server isn't going to be any
>>>wiser until it gets another HTTP request.
>>>If looking at the page counts as "being on the site" but sleeping, or
>>>being dead, doesn't, then the original problem remains unsolvable.
>>>Either you run the risk of logging the user off while he/she's still
>>>reading the pages, or the risk of keeping the user logged on when he/she
>>>doesn't have anything to do with the page any more.
>>>

>>
>>The original poster referred to "Logging in"
>>If you login, you have a Session created.
>>In your web.xml you have a timeout value for a session.
>>If there isn't activity (navigation etc..) associated with a given
>>session in N amount of time, the session is invalidated, and is there
>>are SessionListeners registered, they will be notified.
>>Once notified, descrement a counter.

>
>
> A timeout value is inherently only an approximation. No matter what you
> choose the timeout value as, there is no law forcing users to stop
> looking at the site *exactly* when the timeout expires. Some of them
> might stop sooner, some of them might stop later. Your server isn't
> going to know for sure, it can only guess. This is what I've been saying
> all along.
>

This has turned into a foolish discussion. Your opinions have no
technical merit in the light current accepted practices, at least in the
J2EE world.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
We are currently buying Foundy Networks - primarily NetIron MLX andXMR but are also looking for BigIron RX, ServerIron WMS7, and FastIronFESX's. If you have the above or have access to the above from a clientlooking ro recover value, please sen Network/Software Buyer Cisco 1 07-30-2010 01:25 AM
How to find a file or a device is currently used by which processor which program ? fdu.xiaojf@gmail.com Python 0 10-10-2006 08:17 AM
I guess no one knows how to get the web path to currently selected theme? ThazKool ASP .Net 1 09-30-2006 06:54 PM
pls, help.. i need a number..pls olabanji timothy MCSE 7 09-10-2003 04:02 PM



Advertisments