Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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: 3819
10
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic