• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where to write this method in my application?

 
Ravi Kumar Ravuru
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Folks,
I had a application which is deployed on IBM Websphere Application Server 4.0.1 Advanced Edition for MultiPlatforms.The application is abt tracking of users which consists of Jsps and EJBs.Where should i write the methods for HttpSessionListener in my application.Please give me the suggestions.
Thanks in Advance.
Ravi
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
create a class which should implement that httpsessionlistener interface and then put it in the session.
in this you can implement the methods and do work like initializations and cleanup.
 
Ravi Kumar Ravuru
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Prabhat,
Thanks for your response.Can u send me a piece of code related it.
Thanks in advance.
Ravi
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is it. edit it to suit ur needs
 
Ravi Kumar Ravuru
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Prabhat,
Thanks for the code.Just one more question.How do i keep this class in the session object and track the users.
Thanks in Advance.
Ravi
 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The idea is to use place this in application scope.
Use a Hashtable to store users in. Store the hashtable in the application scope. You can modify the code in the previous post to do this.
Then when a session expires, you have to have an event hook to log them out. You do this by implementing the HttpSessionListener interface. Below is a sample of this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic