Prerequisites:
You've downloaded and extracted Tomcat 7.
You have Eclipse and Java EE SDK installed.
What we do:
We create a new Tomcat7 Server in Eclipse
We create a new maven project using the webapp archetype
We add a couple of properties to the POM file to tell maven to use java 7
maven.compiler.target: 1.7
maven.compiler.source: 1.7
We add the the "missing" src/main/java foulder.
We set the project runtime to tomcat7 so it will know about the container provided classes.
We deploy the project and check if the default index.jsp file is accessible and working.
Then we create a new servlet and add a simple implementation in the GET method, to print a text.
We check if the servlet works.
We edit the web.xml so that the new servlet will now be accessible on /hello instead of /hi.
Ещё видео!