404 Not Found
When I try to run the servlet the server return to me and exception
I created servlet "HelloWorld" and saved it under webapps>ROOT>utils>WEB-INF>classes.
I created the web.xml file to map it, and I saved it under webapps>ROOT>utils>WEB-INF.
when I click http://localhost:8080/utils/hello to run servlet, appears:
404 Not Found /utils/hello was not found on this server.
what's the problem?
It could be your web.xml file. U have to do the right mapping between the page and the .class file.
Try to show us your web.xml please.
I created the web.xml file to map it, the web.xml look likes below and saved it under webapps>ROOT>utils>WEB-INF.
take the utils directory from root and place it under webapps directory. so, now new path is tomcat>webapps>utlis>WEB-INF>
make new dir classes under WEB-INF and place the class Hello in classes.
make web.xml as follows and place it under WEB-INF:
<?xml version="1.0" encoding="ISO-8859-1"?>
This will work
and type the following url in browsers address bar:
to run servlet
better way u can use this structure
In webapps create MyApps in that create WEB-INF in this u can copy that web.xml file.
In WEB-INF create classes folder.
since it is a servlet... i think the url should be http://localhost:8080/utils/servlet/hello
if you are using tomcat