• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creatin plugin

 
arun krishnamurthy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to create plugin.
For example if i want to store some data into Context Opject before any request comes,ie during servlet instantiataion, how can we do that?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65128
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not what I would term a "plugin".

But the answer to your question is to use a context listener that will execute when the web app starts prior to any requests being serviced.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question always arises: how can I make sure something happens as soon as I load a web module; or how can I initialize something as soon as an HttpSession is created. The solution is to use a lifcyle listner, such as an HttpSessionListener or a WebContextListener.

Here's a tutorial on how to create a web context listener, and an HttpSesionListener:

http://www.technicalfacilitation.com/examscam/tf/get.php?link=09lifecyclelisteners

The code for one of these things looks something like this:



Of course, you have to edit the old web.xml file too, don't forget!

Cheers!

-Cameron McKenzie
 
arun krishnamurthy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Cameron
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic