Wednesday, October 14, 2026

Debian 13: jakarta tomcat create servlet using Netbeans

This steps use Netbeans version 31.

to create tomcat apache project in netbeans follow these steps:

  1. open your netbeans
  2. File -> New Project -> java with Maven -> Web Application
  3. fill "Project Name" e.g. My Servlet
  4. in New Web Application -> Server click Add
  5. select Apache Tomcat or TomEE
  6. select your jakarta tomcat directory
  7. fill username and password from tomcat-users.xml file which is has rule rolename="manager-gui"
  8. Finish will return to New Web Application, then Finish 

to create a new servlet

  1. From your project, create New -> Servlet
  2. Class Name: HelloWorld, then next
  3. Servlet Name: My Servlet
  4. URL Pattern: /HelloWorkd
  5. This will create default response
  6. run from your netbeans, and your HelloWorld will appear in browser with url http://localhost:8080/MyServlet/HelloWorld