alain:how could I read the web.xml file directly from the thread?
Well nothing stops you from reading a file on the file system! However, you would need to know which web.xml to read i.e. the path of the file on the filesystem.
This means that the thread reading the web.xml needs to be passed some contextual information, and this is exactly what Ulf suggested.
You may choose to pass the file path and read web.xml yourself or just passed the ServletContext that will read the xml for you.
The choice is yours, but indeed the sensible one will be to pass the ServletContext!