These exercises introduces the Spring MVC Controller and reviews our Maven setup, Slf4j, and log4j. We will review each of the files, annotations, and definitions we will use to create a simple Spring MVC project.

Ex-G3: Make a HelloSpringController3MavenProj using the instructions below

  1. Make a copy of our HelloSpringController2MavenProj and name it HelloSpringController3MavenProj
  2. Set your pom.xml groupId to your own and the artifactId to hello-mvc-controller3
  3. Close HelloSpringController2MavenProj . Use HelloSpringController3MavenProj for this exercise.

  4. Change the display name to HelloSpringController3
  5. Update your index.jsp in the webapp folder to forward to a greeting.do file
  6. Change the servlet url to map *.do
  7. Update the greeting.jsp to show the name attribute after the greeting using EL.
  8. 		<h1>Greetings ${name}</h1>
    
  9. Rename your web context root to hello-controller3
  10. Run the project – “Run As” -> “Run On Server” and choose our Tomcat Server

  11. Look at the controller and greeting.jsp. Without any code changes make the Greeting say Greetings
  12. Browse to localhost:8080/hello-controller3