• Post Reply Bookmark Topic Watch Topic
  • New Topic

servlet conatainer model

 
ahmed, ishtiaq
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i know that the object implementing the HttpSessionListner ( and other listners ) is notified when something happens
1) the question is who raises the events means who notifies the objects
2) the other question is how can we access the objects from the servlet.
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3891
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>1) the question is who raises the events means who notifies the objects
The servlet container.
>2) the other question is how can we access the objects from the servlet.
You need not (and I believe you cannot) access those objects any otherway. As their behaviour is specified by the interfaces they implement, it would be unwise to call the interface methods on them when no such event happens. For ex. an HttpSessionListener may do something when a session is created. Now, why would you want to call that method explicitly by forging the HttpSessionEvent??

------------------
SCJP2, SCWCD Resources, Free Question A Day, Mock Exam Results and More!
www.jdiscuss.com
Get Certified, Guaranteed!
JQPlus - For SCJP2
JWebPlus - For SCWCD
JDevPlus - For SCJD
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!