---
title: "Discussion on \"How to create Java Servlet with Tomcat and Maven in VS Code.\" | Hashnode"
description: "Discussion on \"How to create Java Servlet with Tomcat and Maven in VS Code.\". Before we begin, It is good to note that this article is intended not to use some of the supportive frameworks, which most of them will perform most of the work without developer much efforts, so it is good to say it is intended to focus on the core ..."
url: "https://hashnode.com/posts/how-to-create-java-servlet-with-tomcat-and-maven-in-vs-code/61ec3d0ca12088017fbea1f0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to create Java Servlet with Tomcat and Maven in VS Code.](https://nyumbani-coder.hashnode.dev/how-to-create-java-servlet-with-tomcat-and-maven-in-vs-code?utm_source=hashnode&utm_medium=feed)

Before we begin, It is good to note that this article is intended not to use some of the supportive frameworks, which most of them will perform most of the work without developer much efforts, so it is good to say it is intended to focus on the core ...

Jan 22, 2022 · 7 min read · nyumbani-coder.hashnode.dev  
Read the article

-   [#java](https://hashnode.com/tag/java)
-   [#maven](https://hashnode.com/tag/maven)
-   [#apache](https://hashnode.com/tag/apache)
-   [#vscode](https://hashnode.com/tag/vscode)
-   [#server](https://hashnode.com/tag/server)

## Written by

[Gabriel Rogath](https://hashnode.com/@GabrielRogath)

@GabrielRogath

  
[View profile](https://hashnode.com/@GabrielRogath)

Software Developer

## Responses 3

Markdown supported · ⌘↵ to post

[wissem hajbi](https://hashnode.com/@Oidysts)

[Feb 21, 2023](https://hashnode.com/posts/how-to-create-java-servlet-with-tomcat-and-maven-in-vs-code/61ec3d0ca12088017fbea1f0/comment/63f4b2bef338bec1cf2dd474)

the terminal tells me that "run" is not recognized as cmdlet ?

[Gabriel Rogath](https://hashnode.com/@GabrielRogath)

[Feb 21, 2023](https://hashnode.com/posts/how-to-create-java-servlet-with-tomcat-and-maven-in-vs-code/61ec3d0ca12088017fbea1f0/comment/63f4b2bef338bec1cf2dd474#reply-63f4bedd75350fc1ff6904a9)

Hello wissem, could you provide more insight on on which stage do you get this error? So as I can try to help.

[Ben Bi](https://hashnode.com/@bennybi)

[Jan 6, 2023](https://hashnode.com/posts/how-to-create-java-servlet-with-tomcat-and-maven-in-vs-code/61ec3d0ca12088017fbea1f0/comment/63b7d247624134a0c9b2f8f2)

Hello, do u know how to setup vhost on it?, to remove "servlet-1.0-SNAPSHOT/" path, since the static assets in .war cannot be accessed.

[Gabriel Rogath](https://hashnode.com/@GabrielRogath)

[Feb 21, 2023](https://hashnode.com/posts/how-to-create-java-servlet-with-tomcat-and-maven-in-vs-code/61ec3d0ca12088017fbea1f0/comment/63b7d247624134a0c9b2f8f2#reply-63f4c135f338bec1cf2dd722)

some server will require you to rename the .war file to root.war file

[Babatunde Ayinla](https://hashnode.com/@ayinlab)

[May 24, 2022](https://hashnode.com/posts/how-to-create-java-servlet-with-tomcat-and-maven-in-vs-code/61ec3d0ca12088017fbea1f0/comment/628d004cb4bd016fc9a31b9a)

I have been getting error 404 at my final step. I guess the issue is the path to my servlet when tomcat is trying to reference it. It does not visit the directory in the browser url. How do I specify the path?

[Gabriel Rogath](https://hashnode.com/@GabrielRogath)

[Feb 21, 2023](https://hashnode.com/posts/how-to-create-java-servlet-with-tomcat-and-maven-in-vs-code/61ec3d0ca12088017fbea1f0/comment/628d004cb4bd016fc9a31b9a#reply-63f4c07c75350fc1ff6904e4)

404 error, is a page not found or file not found error. could be your mapping file web.xml is not well configured
