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 8179851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:05:22+00:00 2026-06-07T00:05:22+00:00

I use eclipse + tomcat + maven. When I deploy my project to Tomcat,

  • 0

I use eclipse + tomcat + maven.

When I deploy my project to Tomcat, the following entry gets added to the server.xml of the tomcat configuration:

<Context docBase="C:\ws_eclipse\ws\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\MyApp" path="/myApp" reloadable="true" source="org.eclipse.jst.jee.server:MyApp"/>

What I actually want is to add an environment variable so that the context looks like this:

  <Context docBase="C:\ws_eclipse\ws\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\MyApp" path="/myApp" reloadable="true" source="org.eclipse.jst.jee.server:MyApp">
       <Environment name="config.file" type="java.lang.String" value="C:/test/config.xml" /> 
</Context>

I tried adding it as an environment variable in eclipse run configuration, but when I deployed the application on tomcat, the context does not include the environment variable.

  • 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-07T00:05:23+00:00Added an answer on June 7, 2026 at 12:05 am

    You could add a context.xml file in the META-INF directory of your webapp. The content of this file may look like:

    <Context>
      <Parameter name="config.file" value="C:/test/config.xml"/>
    </Context>
    

    This has the same effect as defining a <context-param/> in your web.xml. Use ServletContext.getInitParameter("config.file") to retrieve it’s value as a String.

    You may use Environment as well, but it’s probably overkill (You just need a String anyway, I think).

    See http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

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

Sidebar

Related Questions

I use Eclipse J2EE 3.5 with Maven and tomcat. To deploy my maven webapp
I use eclipse to develop an app engine project on maven that require war
I use eclipse for java EE as my IDE and tomcat as my server.
I deploy a application to tomcat with context xml. I want the tomcat work
I am writing a web application with Maven in the Eclipse IDE, and use
I have smallish personal project consisting of the following Eclipse workspace. + +-MyApp //
I am trying to use Tomcat 6.0 as a web development server within SpringSource
My problem is that if I use Eclipse to deploy my Web Application (via
I develop a web application using eclipse, maven and tomcat container. My web app
i use eclipse with tomcat 5.5 and jdk 1.6. i have 2 question 1.which

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.