Hi,
I need to read parameters from ServletContext (for example, the parameters
declared in the Context.xml or the Web.xml of the WebApp).
Once read, these parameters have to be shared as global parameters for the
WebApp.
To get this, I used the injection @Context ServletContext servletContext and
I created a static instance of java.util.Properties (wrapped in a dedicated
PropertiesLoader class).
This works quite well except that I do not know where and when to call the
method that is in charge to initialize the static instance of
java.util.Properties (using the the ServletContext).
This issue is because I have several independant Resources (@path /resrouce)
and all these resources need to refer the static Properties.
My question is:
Is there a proper solutions (with Jersey?) to call the init process at the
start up (or the deployment) of the WebApp before exposing all Resources?
Regards,
exxos.