title: How to get the path of an eclipse project in jsp page
body: <p>How to get the path  of my current project : it's a dynamic web application created with maven archetype . </p>
  
  <p>I want to retrieve the path in my jsp page in scriptlet code , i used different codes but i'm always getting the path of eclipse (C:\Users\Amira\Desktop\eclipse\eclipse)
  or the path of the web application on tomcat ((C:\software\apache-tomcat-7.0.28\apache-tomcat-7.0.28\wtpwebapps\TestProjectUI)</p>
  
  <p>but i want the path of the project in my workspace : C:\Users\Amira\junoWorkspace\TestProjectUI </p>
  
  <p>Any idea will be appreciated 
  Thank you</p>
  
  <p>Here's my jsp :</p>
  
  <pre><code>&lt;body&gt;
  
  &lt;%
  if (request.getParameter("btnSubmit") != null) //btnSubmit is the name of your button,not id of that button.
  {
  
      String className = request.getParameter("testclass");
      System.out.println(className);
      String[] command = {"CMD", "/C", "mvn -Dtest=" + className + " test"};
      ProcessBuilder probuilder = new ProcessBuilder(command);
  
      //You can set up your work directory
      probuilder.directory(new File("C:\\Users\\Amira\\junoWorkspace\\TestProjectUI"));
  
      Process process = probuilder.start();
  
      //Read out dir output
      java.io.InputStream is = process.getInputStream();
      InputStreamReader isr = new InputStreamReader(is);
      BufferedReader br = new BufferedReader(isr);
      String line;
      System.out.printf("Output of running %s is:\n", Arrays.toString(command));
      while ((line = br.readLine()) != null) {
          System.out.println(line);
      }
  
      //Wait to get exit value
      try {
          int exitValue = process.waitFor();
          System.out.println("\n\nExit Value is " + exitValue);
      } catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  }
  %&gt;
  
          &lt;html:file properties="tonFichier" name="tonForm"/&gt;
  
  
          &lt;p&gt;   Please specify a Test :&lt;br&gt;
              &lt;input type="file" name="testclass" size="40" &gt;
          &lt;/p&gt;
          &lt;div&gt;
              &lt;input type="submit" id="btnSubmit" name="btnSubmit" value="Execute Test"/&gt;
  
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>