Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8217235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:23:41+00:00 2026-06-07T12:23:41+00:00

How to get the path of my current project : it’s a dynamic web

  • 0

How to get the path of my current project : it’s a dynamic web application created with maven archetype .

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)

but i want the path of the project in my workspace : C:\Users\Amira\junoWorkspace\TestProjectUI

Any idea will be appreciated
Thank you

Here’s my jsp :

<body>

<%
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();
    }
}
%>

        <html:file properties="tonFichier" name="tonForm"/>


        <p>   Please specify a Test :<br>
            <input type="file" name="testclass" size="40" >
        </p>
        <div>
            <input type="submit" id="btnSubmit" name="btnSubmit" value="Execute Test"/>

        </div>
    </form>
</body>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:23:42+00:00Added an answer on June 7, 2026 at 12:23 pm

    Whenever I have a problem like this, I print out all of the System.getProperties() and see if there is one that has the information I want. This is probably the best you can do here, since the only information provided by Eclipse will come through a property. If you don’t have the information in one of the provided properties, you can provide it yourself as part of your launch configuration, you can use the workspace_loc variable in the launch config stuff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I get the path of the current assembly? I need to get
From Visual C++, how do I get the path to the current user's My
How can I get the current working directory and get the path without the
I'm working on a tool that needs to get the current user's wallpaper path.
How can I get runnig path of my application from app.xaml.cs itself?
Inside the Application_Start of my Global.asax.cs, I am trying to get the current application
Having a method like this: @GET @Path(/name/{name}) @Produces(MediaType.TEXT_PLAIN) public String getProperty(@PathParam(name) String name) {
Looking for a way to get path of file (and then process it in
I wanted to ask if there is any way i can get path of
How do I get the path of a an executed .jar file, in Java?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.