OK, I will change the description of my question.
What I really need is the availability of ServletContext for my application-scoped Seam component, which has a method marked with @Observer(
As I understood this issue has been already addressed:
So can you please tell which API I should use for accessing ServletContext during the startup?
After reading the description in JBoss JIRA one more time it looks like it is my fault.
I haven't seen the date of latest comment:
Christian Bauer [10/Apr/08 10:48 PM]
I renamed this issue because what we really need is a way to access the ServletContext when the SeamListener starts up. Only at that time can you use getResourcePaths() and getResourceAsStream() to look for and process files in your deployment (which the Seam scanner does not cover). This is required to build internal registries in applications, e.g. "all names of directories in my view folder in /templates/".
The Initialization.java class currently has a private reference to that ServletContext we need, during startup. We need to expose this with an API, also without conflicting with the request-based ServletContexts.instance() API already present.
10th of April 2008... so it will take some time until this feature will become available in Seam. And I will have to stick with some workarounds for now :-(