-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make web.xml accessible prior to ServletContext initialisation #9
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented I would really rather avoid encouraging other parsing web.xml, as this does not cover configuration from fragments, API, annotation etc. |
@glassfishrobot Commented |
|
@gregw My suggestion here would be to look at what is missing from the ServletContext API that those CDI extensions are looking for. As CDI is bootstrapped using a ServletContainerInitializer it can access the ServletContext API at that time. Where the actual configuration came from should be irrelevant to the CDI extension as the ServletContext API is the 'materialized view' of a web application where configuration is concerned. |
It would be useful if one could access the contents of the web.xml file, prior to the ServletContext being available.
A use case for this is in writing CDI extensions, where it would be useful to access web.xml configuration data. Currently this is not possible to achieve in a portable way, as the ServletContext has not yet started, and is not available to CDI extensions (in EE environments at least).
Since the WEB-INF folder is not on the classpath, using the context ClassLoader is not possible. Perhaps the solution to this is as simple as adding the WEB-INF folder to the application classpath?
The text was updated successfully, but these errors were encountered: