This steps use Netbeans version 31.
to create tomcat apache project in netbeans follow these steps:
- open your netbeans
- File -> New Project -> java with Maven -> Web Application
- fill "Project Name" e.g. My Servlet
- in New Web Application -> Server click Add
- select Apache Tomcat or TomEE
- select your jakarta tomcat directory
- fill username and password from tomcat-users.xml file which is has rule rolename="manager-gui"
- Finish will return to New Web Application, then Finish
to create a new servlet
- From your project, create New -> Servlet
- Class Name: HelloWorld, then next
- Servlet Name: My Servlet
- URL Pattern: /HelloWorkd
- This will create default response
- run from your netbeans, and your HelloWorld will appear in browser with url http://localhost:8080/MyServlet/HelloWorld