You are right with regards to the mapping in the web.xml.
<servlet-name>HelloWorld</servlet-name> HelloWorld is the java file name
but the only problem is url which you are using to call the servlet. it should be in the following way http://localhost:8080/HelloWorld/hello
in the above URL you have different parts which are necessary. http://<servername>:<port>/<context
name>/<url-pattern or the name of the jsp>
The context name is the name of the folder of your application in the webapps directory of the tomcat.