title: Error while displaying image in jsp
body: <p>First of all, i read tons of posts regarding this but i can't manage to get this working.
  I'm really new to jsp and web apps. All i wanna do is to display a simple image.
  I have this code in the servlet:</p>
  
  <pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      HttpSession sesion = request.getSession();
      String filePath = getServletContext().getRealPath("image.jpg");
      System.out.println(filePath);
      sesion.setAttribute("image", filePath);
      response.sendRedirect("products.jsp");
  }
  </code></pre>
  
  <p>And this code in the jsp:</p>
  
  <pre><code>&lt;img alt="logo" src="${image}"/&gt;
  </code></pre>
  
  <p>And the folders in my web app are this:
  <a href="https://i.stack.imgur.com/RiTyU.png" rel="nofollow noreferrer">folders image</a></p>
  
  <p>And finally, when my page loads, this is what i get:
  <a href="https://i.stack.imgur.com/YPKK3.png" rel="nofollow noreferrer">image does not display</a></p>
  
  <p>I wonder what is the error here? Why it is so complicated (maybe it's not, but i really tried many ways and non of them worked) to display a simple image?</p>
  
  <p>Thanks in advance for your help!</p>
  
  <p>PS: the folder is correct, it prints without problem in the println()</p>