Hello World with Spring 3.0

This post explains how to implement a simple web application with Spring 3.0 on Tomcat.

I used the following tools:

  • Java 1.6.0_22
  • Tomcat 6.0.20
  • Spring 3.0.4
  • NetBeans 6.9
  1. In your IDE create a project called Hello World
  2. Add the following libraries:
    • commons-logging.jar
    • org.springframework.aop-3.0.4.RELEASE.jar
    • org.springframework.asm-3.0.4.RELEASE.jar
    • org.springframework.aspects-3.0.4.RELEASE.jar
    • org.springframework.beans-3.0.4.RELEASE.jar
    • org.springframework.context-3.0.4.RELEASE.jar
    • org.springframework.context.support-3.0.4.RELEASE.jar
    • org.springframework.core-3.0.4.RELEASE.jar
    • org.springframework.expression-3.0.4.RELEASE.jar
    • org.springframework.instrument-3.0.4.RELEASE.jar
    • org.springframework.instrument.tomcat-3.0.4.RELEASE.jar
    • org.springframework.jdbc-3.0.4.RELEASE.jar
    • org.springframework.jms-3.0.4.RELEASE.jar
    • org.springframework.orm-3.0.4.RELEASE.jar
    • org.springframework.oxm-3.0.4.RELEASE.jar
    • org.springframework.test-3.0.4.RELEASE.jar
    • org.springframework.transaction-3.0.4.RELEASE.jar
    • org.springframework.web-3.0.4.RELEASE.jar
    • org.springframework.web.portlet-3.0.4.RELEASE.jar
    • org.springframework.web.servlet-3.0.4.RELEASE.jar
    • org.springframework.web.struts-3.0.4.RELEASE.jar
  3. Create the file /WEB-INF/web.xml
  4. Create the file /WEB-INF/HelloWorld-servlet.xml
  5. Create the file index.jsp in the application root
  6. Create the directory /WEB-INF/views and the file /WEB-INF/views/helloWorld.jsp
  7. Create the file /WEB-INF/classes/it/helloworld/controller/HelloWorldController.java
  8. Deploy and launch the application

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.