title: How do I open a file located in WEB-INF?
body: <p>My servlet lets user upload a file, I've created a button to view the uploaded file.</p>
  
  <p>now, on click of that button I want the uploaded file to open. How do I do this on the JSP side or servlet.java side?</p>
  
  <p>it is located in WEB-INF/Uploads/my.txt folder.</p>
  
  <p>=====================================EDIT=========================================</p>
  
  <p>Based on answers below, I've modified my code and I'm pasting the same here for more answers,</p>
  
  <pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
  {
      ServletContext context = getServletContext();
      String path = context.getRealPath("/u/poolla/workspace/FirstServlet/WebContent/WEB-INF/Uploads/Config.txt");
      FileReader reader = new FileReader(path);
      BufferedReader br = new BufferedReader(reader);
      String firstline = br.readLine();
      System.out.println(firstline);
  
  }
  </code></pre>
  
  <p>PS: This is not working, still looking for answers.
  Thank You!</p>