I want to know the directory structure for using servlet 3.0 with Tomcat 7. I have used annotation @WebServlet without initialization parameters.
I want to know what is to be written in web.xml file then?? Is and is still to be written...??
The file is stored in the classes folder of the tomcat.
This is all you need in web.xml
:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
3.0-compatible servlet container (like Tomcat 7) will find @WebServlet
automatically.