• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ASP to JSP conversion: events in the Global.asa file

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am converting an ASP application to a JSP ( and servlets). My problem is where am I going to move the methods in Global.asa file(s) ( i.e. Session_OnStart() , Session_OnEnd(), and Application_OnStart() ).
Simply what I want is to trigger those events so that i am able to update some application wide variables. But do not know where the necessary changes should go.
Anybody got a clue ? please help.
:roll:
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As for notification on application start, you can install a servlet for that purpose with a web.xml directive to load it on startup, and put your initialization code in the servlet's init method.
In the servlet 2.3 spec, you can configure a listener to be called any time a session is created or destroyed. You specify the implementation class in your web.xml file, and handle the events in the listener class. In prior servlet versions, the best way to accomplish this was to make sure all your sessions got created in one place, and do the initialization there.
Chris
 
Ant Swa
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Chris, Can you explain little bit on the last part of your answer: "the best way to accomplish this was to make sure all your sessions got created in one place, and do the initialization there"

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic