This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Can you tell us what prompted this question? (I'm not sure how Ivan's answer is supposed to help.)
Ivan Jozsef Balazs
Joined: May 22, 2012
Ulf Dittmer wrote:I'm not sure how Ivan's answer is supposed to help.
I gave the hint to the version data sheet about how the Tomcat version and the supported Servlet version match.
For example Apache Tomcat version 7.0 supports Servlet API 3.0.
I must admit to have tried Apache Tomcat version 7.0 so that the servlet was not declared in web.xml but was declared with annotations and it worked.
There was a web.xml however with welcome file and resource information, so I did not try this feature with a completely missing web.xml.
With the new Servlet specification 3.0 and Java 5 (Annotation) introduction we can completely discard web.xml for particular servlet. My question/doubt is how container (Tomcat 7) resolve the servlet with annotations. Also can we deploy a WAR having one HelloworldServlet servlet without web.xml [using Tomcat Server 7.x]