title: To pass the path of the uploaded file to the Java program
body: <p>I have created two JSP programs as follows.</p>
  
  <p>First One: Addmulti.jsp</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;Upload Excel File&lt;/title&gt;&lt;/head&gt;&lt;/p&gt; &lt;p&gt;&lt;body&gt;
  &lt;form action="Test2.jsp" method="post" enctype="multipart/form-data" name="form1" id="form1"&gt;
  &lt;br&gt;&lt;br&gt;
  Upload File:
  &lt;input name="file" type="file" id="file"&gt;&lt;br&gt;&lt;br&gt;
  &lt;input type="submit" name="Submit" value="Submit"/&gt;&lt;br&gt;&lt;br&gt;
  &lt;input type="reset" name="Reset" value="Reset"/&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Second one: Test2.jsp</p>
  
  <pre><code>&lt;%@ page import="myfirst.*" %&gt;
  &lt;%
  
  String filevar=request.getParameter("file");
  String result="";
  myfirst.SearchLink z=new myfirst.SearchLink();
  result=z.addmultiple(filevar);
  System.out.println(result);
  out.println(result);
  %&gt;
  </code></pre>
  
  <p>SearchLink is a java program which contains the method as below,</p>
  
  <pre><code>public String addmultiple(String file)throws SQLException{
          return file;
  }
  </code></pre>
  
  <p>I want the complete path of the file that is selected in the first jsp program mentioned above to be transmitted to the java method named addmultiple(String). Instead, null is getting printed in the browser as output once the Test2.jsp program is called.</p>
  
  <p>What actually will be passed to the method with the parameter String in the code described above? </p>
  
  <p>How to send the complete path of the file that is selected in the first jsp code to the java program? Please advise.</p>