How to add a servlet? Create a servlet class. Override respondeToGet or respondeToPost or both. Add the url path and the qualified name of the servlet to resources/servlets.properties file.