title: Maven - Eclipse - Project I am trying to add an image to database , The image doesn't appear in my JSP page until i refresh the image
body: <p>This is the Controller page in which i have added my Image Upload Section . 
  When I add the product image to my database using a multi-part file and when i am listing it , the product thumbnail appears , once i refresh the resources - only then the image is displayed when i list it . 
  let me know what i should do . </p>
  
  <pre><code>@RequestMapping(value="/saveProd", method=RequestMethod.POST)
      public ModelAndView gotoSave(@ModelAttribute("prod")Product prod,ModelMap m, Model a)
   {
       MultipartFile file = prod.getFile();
       String fileName = "";
  
       String image="";
       if(!file.isEmpty())
       {
            try
            { 
                System.out.println("inside try");
          fileName = file.getOriginalFilename();
          byte[] filesize=file.getBytes();
          BufferedOutputStream bout=new BufferedOutputStream(new FileOutputStream(new File("\\C:\\Users\\GOOD\\workspace\\fionazcosmetics\\src\\main\\webapp\\resources\\images\\" + fileName)));
          bout.write(filesize);
          bout.close();
          image="/resources/images/"+fileName;
          //r.setAttribute("img" ,image);
          m.addAttribute("img", image);
          System.out.println("upload sucess.."+image);
  
            }
            catch (IOException e) {
                System.out.println("upload failed..");
                e.printStackTrace();
            }
       }
       List&lt;Supplier&gt; x = supplierservice.getList();
       a.addAttribute("sList",x);
       List&lt;Category&gt; abc = categoryservice.getList();
       a.addAttribute("cList",abc);
       productDAOservice.insertRow(prod,image);
       List ls=productDAOservice.getList();
       return new ModelAndView("productadd","listProd",ls);
       }
  </code></pre>