then the issue is you can't test it in embedded and you use proprietary stuff for something provided by the container ;) + in some container it doesn't work really well because of the lifecycle of containers Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau
2014/1/21 Karl Kildén <[email protected]>: > Hello, > > My recommendation would be to use the Servlet Module from deltaspike. I use > it for booting and it's really comfortable. See > http://deltaspike.apache.org/servlet.html > > It's been mentioned as a todo in Omnifaces as well as in Deltaspike but the > relevant discussion in deltaspike lead me to believe that it was a > problematic approach. So yeah Servlet Module +1. > > > > > public void onCreate(@Observes @Initialized ServletContext context) { > System.out.println("Initialized ServletContext: " + > context.getServletContextName());} > > > > On 20 January 2014 16:30, Martin Strohal <[email protected]> wrote: > >> Hi, >> >> I'm using TomEE 1.5.2 and I want some application code to be executed on >> application (WAR) startup. It's a loader which reads a configuration file. >> The class is a CDI class, but no other class has a reference to it. That's >> why it is not created normally. >> What's the best way to do that? Must I convert the class to an EJB? Or is >> there a CDI mechanism? >> >> Thanks! >> >> Martin >>
