• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Where to write this method in my application?

 
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic