Issue Details (XML | Word | Printable)

Key: SERVLET_SPEC-9
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Shing Wai Chan
Reporter: bleathem
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
servlet-spec

Make web.xml accessible prior to ServletContext initialisation

Created: 06/Sep/11 07:50 PM   Updated: 22/Feb/13 10:28 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Tags: FUTURE_RELEASE
Participants: bleathem, rojkov and Shing Wai Chan


 Description  « Hide

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?



rojkov added a comment - 07/Dec/11 02:38 AM

I think this needs a use case. I can't not suggest that parsing web.xml yet another time should be avoided. Possibly, we can define a pre-start phase that makes the xml available in parsed state.


bleathem added a comment - 07/Dec/11 07:38 AM

A use case is as I stated in the issue description, where one wants to access the web.xml from a CDI extension. For instance, to determine the JSF project stage, to conditionally activate different beans in production and development.


Shing Wai Chan added a comment - 08/Jan/13 10:18 PM

At this time, we don't expose the content of web.xml in Servlet API.
Where do you want to access the information contained in the descriptor and how can we reconcile the information specified by annotation?
It will be consider in the future release.


Shing Wai Chan added a comment - 22/Feb/13 10:28 PM

Adding it to the bucket of FUTURE_RELEASE