• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to register the listeners

 
narendra darlanka
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i read that we can register ServletContextListener by using the deployment descriptor.but how do i register other listeners like HttpSessionListener ,HttpRequestListener?

thanks inadvance
 
Sergey Tyulkin
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the same way:
<listener>
<listener-class>
com.my.ImplementationOfHttpRequestListener
</listener-class>
</listener>
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All listeners are registed through the web.xml
listeners tag. They are automatically used appropriately (probably using instanceof ).
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!