Now, i have been told that this is no longer the way to invoke a servlet and i also need to declare and map my servlet in the web.xml file (deployment descriptor)
Please could someone point me in the correct direction.
The answer to your question is general, you need to understand the basic concepts of deployment for this. Here is the link to find out. If you have a book on the subject, just go to the index, look for deployment jump there.
Anyways I found this topic is a version of this topic .
So moving this one. Please paste all your servlets questions in the servlets forum. Read this to know why this is important.