tom davies wrote:I have my servlet in a package named servlets in netbeans. I wrongly thought i would navigate to it using /servlets/ . .
Right -- the package has nothing to do with the URL mapping.
It has worked now i just have the servlet name.
Warning! This will only work when the web app is the root web app.
You should always fetch and include the context path when forming URLs in web pages (such as for images and form actions). For the root web app, the context path just happens to be the empty
string. Your app will break if the app is depoyed using a differnt context path.
See the
JspFaq for how to fetch the context path in a
JSP.
I have also just changed it to out.println("message"); instead of the html
Emitting HTML is fine while you are learning. I just wanted to make sure it did not become a bad habit that you'll need to unlearn later.