I do not know if you are using a framework like Spring, but if you are using pure Servlet you need to configure the web.xml file for the project:
Something like this:
<servlet>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>pacote.LoginServlet</servlet-class>
</servlet>
<servlet-mapping>
// Classe servlet que responde por essa URL
<servlet-name>LoginServlet</servlet-name>
// URL que deseja mapear
<url-pattern>/login</url-pattern>
</servlet-mapping>
To create the file in NetBeans:
1. On the top menu, click File, choose New File.
2. On the screen that opens, select Web Category, then select Standard Deployment Descriptor.
3. Click Next.
4. Click Finish. The web.xml file will be created in the web directory / WEB-INF /.