Reputation:
I have my json file that I am going to place under web-app folder. This file is not generated on the fly but created manually. Hence want to store under web-app. I need to render the page in jsp/servlet using this json file. How to get access to json file in this scenario?
Upvotes: 1
Views: 772
Reputation: 113
Create a servlet and serve the file from there to the clients. You can load it with
servletContext.getResourceAsStream("/WEB-INF/file.json");
and write it directly to your OutputStream.
Upvotes: 1