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

  • Home
  • SEARCH
  • 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 8926683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:01:51+00:00 2026-06-15T08:01:51+00:00

I am using Maven 3 to build my project. I have a web application

  • 0

I am using Maven 3 to build my project. I have a web application that I want to define the custom root. According to the Tomcat 6 Documentation it says:

The locations for Context Descriptors are: 
1.  $CATALINA_BASE/conf/[enginename]/[hostname]/context.xml 
2.  $CATALINA_BASE/webapps/[webappname]/META-INF/context.xml

Files in (1) are named [webappname].xml but files in (2) are named context.xml. 
If a Context Descriptor is not provided for a Context, Tomcat configures the Context using default values. 

I want to use a custom root that I define. How can this be achived because when I define the custom context.xml file, the path is not being seen in Tomcat. According to the above, it mentions if a Context Descriptor is not provided for a Context, Tomcat configures the Context using default values. I have already defined my Context Descriptor as seen below in context.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/data1"/>

When I deploy deploy.war, into Tomcat I cannot access /data1 does not work. However, /data works. When the war file is deployed, it has META-INF with the context.xml located.

My POM file:

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
 <groupId>com.data</groupId>
 <artifactId>Java-WebApp</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <packaging>war</packaging>

<name>Java-Web Application</name>

<!-- Shared version number properties-->
<properties>
<org.springframework.version>3.0.6.RELEASE</org.springframework.version>
</properties>

<dependencies>
   <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
</dependencies>
<build>
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.0</version>
        <configuration>
            <webResources>
                <resource>
                    <directory>${project.basedir}/src/main/resources</directory>
                </resource>
            </webResources>
        </configuration>
    </plugin>
</plugins>
<finalName>data</finalName>
</build>

<parent>
<groupId>com.data</groupId>
<artifactId>Java-Parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
</project>

I have looked into the following website but don’t seem to help:

Define Servlet Context in WAR-File

  • 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-15T08:01:55+00:00Added an answer on June 15, 2026 at 8:01 am

    Looking at your pom, the name of the war file should be “webchannel”.

    You don’t have to add a context.xml. Just let the url be determined by war file name, and any mappings you have created in project.

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

Sidebar

Related Questions

I have a web project. I build it using maven(complete all stages in every
I'm using maven to build a Java web application which is run in Tomcat.
I'm working on a Java web project that uses Maven to build its artifacts.
I have a maven web project that imported into eclipse. I have another maven
I have created a web application using Jersey and Dynamic Web Project of Eclipse.
I have a maven web app build using Eclipse, and have this command: install
I have a web application built using maven. It is built in the form
I have been working on this web application using Eclipse and m2e (maven plugin
Im using maven to build a multi module project. But some projects are in
I am using maven to build applications. I have deployed a WAR file containing

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.