I haven't embedded jetty quite like this, but I've used it a bit. Unless there's something that I'm missing, it seems to me that calling:
context.addListener(EnvironmentLoaderListener.class) should do the trick. Won't jetty then call "contextInitialized" when, well, the context is initialized? (and actually, looking at the code in ContextHandler.startContext, it appears that this should happen) -Jared On Fri 04 May 2012 02:17:15 PM CDT, Les Hazlewood wrote: > Oops - that's not correct, sorry - it does require > event.getServletContext() to function. If your event instance can > return a valid ServletContext instance, it will work. > > Les > > On Fri, May 4, 2012 at 12:15 PM, Les Hazlewood <[email protected]> wrote: >> Shiro doesn't actually inspect the event, so you can instantiate it >> however you want - it just uses it as a trigger mechanism to execute >> startup/shutdown work. >> >> Cheers, >> >> Les >> >> On Fri, May 4, 2012 at 1:14 AM, MattShaw <[email protected]> >> wrote: >>> Thanks Jared and Lee. >>> >>> I took Jared's advice and got it working with Shiro 1.1 with the code and >>> config changes. :-) >>> >>> I then upgraded to Shiro 1.2 and took Lee's code as a start point. >>> >>> However new ServletContextEvent() doesn't have a default constructor. I've >>> tried lots of options but they all fail with various expections. How should >>> I construct a ServletContextEvent to enable this to work with Shiro 1.2?? >>> >>> context.callContextInitialized(listener, new ServletContextEvent(????)); >>> >>> Thanks for all your help so far and I'm sure this is a quick fix. >>> >>> Best regards >>> >>> Matt >>> >>> -- >>> View this message in context: >>> http://shiro-user.582556.n2.nabble.com/Integration-of-Shiro-with-Embedded-Jetty-tp7519712p7526297.html >>> Sent from the Shiro User mailing list archive at Nabble.com.
