0

i am deploying an war file (consists of jpa and servlet stuff) on glassfish (the most recent one)

I wanna insert/check some data right after i deploy my war file via JPA.

What/Which class to override what/which method?

I am currently overriding servlet's init method. It is only called when I request that servlet from my browser. I want it to be invoked when the war is deployed right after. Injections has to be gone through in all servlets

DataNucleus
  • 15,497
  • 3
  • 32
  • 37
Hayati Guvence
  • 718
  • 2
  • 6
  • 22

1 Answers1

3

You can use ServletContextListener. If you want to use Servlet's init() then make sure you specify load-on-startup

Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327