File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to register the listeners

 
narendra darlanka
Ranch Hand
Posts: 66
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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 ).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic