Forums Register Login

Reading file

+Pie Number of slices to send: Send
I want to read an XMl file that is placed somewhere in the web-root/WEB-INF/ folder in the deployed war on the server.
How can I read the file from here by dynamically getting the complete file path??
+Pie Number of slices to send: Send
Look at the api for the javax.servlet.ServletContext interface.
With a ServletContext there are several possibilities - getResourceAsStream is popular or you can getRealPath to get an absolute path String.
Bill
+Pie Number of slices to send: Send
thanks a lot for the help
What's wrong? Where are you going? Stop! Read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1038 times.
Similar Threads
Reading file attributes from local file system
Reading a File in a JSF project.
Properties file path hard coded
Need Advice on Global Configuration
about xml files use
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 20:35:49.