This content has been marked as final.
Show 2 replies
-
1. Re: Accessing bean in @Filter
shane.bryzak Nov 21, 2007 12:44 PM (in response to toby451)Look at SeamFilter.init() for an example, it creates an application context.
-
2. Re: Accessing bean in @Filter
toby451 Nov 21, 2007 2:16 PM (in response to toby451)Thanks for your quick response! Works fine.
I'll post it here as well (for anyone in the same situation):public void init(FilterConfig config) throws ServletException { Lifecycle.mockApplication(); try { ApplicationSettings settings = (ApplicationSettings) Component.getInstance("applicationSettings"); foo = settings.getFoo(); } finally { Lifecycle.unmockApplication(); } }