title: How to add Message box instead of new window in jsp
body: <p>What I have tried is </p>
  
  <pre><code>First.jsp
     &lt;form name = "button" style="VISIBILITY: visible"&gt;
                      &lt;table cellspacing=5 cellpadding=5 bgcolor="lightblue" colspan=2 rowspan=2 align="center"&gt;
       &lt;TR&gt; &lt;TD&gt; &lt;INPUT TYPE="button" onclick="sub1();hide();" VALUE="DOWNLOAD"&gt;&lt;/TD&gt;
      &lt;script&gt;
       function popup()
                      {
                          popupWindow = window.open('delete','name','width=300,height=100');
                          popupWindow.focus();
                          window.close();     
                      }
  </code></pre>
  
  <p>delete.jsp</p>
  
  <pre><code>&lt;%
  String Pdfpath=   session.getAttribute("pdfpath").toString();
   File f =new File(Pdfpath);
  
   Boolean flag=false;
    if(f.exists())
    {
      flag=f.delete();
    }
    else 
    {
      out.println("File not found to delete");
    }
  
  %&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Delete file in java&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;%
   if(flag==true)
   {
    out.println("File Has Bean deleted successfully");
   }
   else
   {
    out.println("Error: Unable To Delete The File");
   }
  %&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>From my first jsp I'm passing some path to another delete.jsp  on the button click.That jsp delete the file on my directory and giving an message.I want that message to comes of in a message box at the same time that window should not come.</p>
  
  <p>I don't like add all deletion code in javascript function so that I'm going for another jsp. Is it possible to hide the window and show only the confirm message box in delete.jsp page.I need some help.</p>
  
  <p>Thanks</p>