0

I want to add pluggable jar i.e. the jar with web-fragment.xml after server is up-and-running. and perform the scanning of this jar and initialize servlet components defined in web-fragment.xml of newly added jar.

If this is not possible please explain the reason.

himukr
  • 91
  • 1
  • 6

1 Answers1

1

Each Java EE application is atomic. It is deployed and undeployed entirely. You can't change application without redeploy. So it is not possible.

Correct solution is differ. You should deploy independent application and provide pluggable interfaces between main application and such plugins. Technical details are depends from situation. E.g. JSF has resource-handler. You can write special class (need be registered in faces-config.xml) for loading JSF pages from nonstandard place.

sibnick
  • 3,995
  • 20
  • 20
  • Thanks for reply @sibnick. So from your reply, I can not add new servlet component from web-fragment at runtime. but do we have any mechanism by which i can perform entire scanning of jar and initialization of web.xml again programatically so that my web-fragment gets picked up without restarting server. – himukr Sep 29 '15 at 14:45
  • Most Java EE servers have ability reload application if it was changed. It is called hot-redeploy feature. – sibnick Sep 29 '15 at 15:01