Spring/SpringMVC v3.2.1 Integration

This sample demonstrates Spring and Spring MVC integration through a simple phonebook Web application deployed to Liberty.

This sample can be installed onto runtime versions 8.5.5.0 and later.

Installation Instructions

Online installation (requires 8.5.5.6 or later):

  1. Install the sample by running the command below from the bin directory of your server installation:
    installUtility install SpringSample

Any missing features required by the server will be installed for you.

Offline installation:

  1. Download the SpringSample.jar using the download button at the top of the page and place it in the root of your server installation.
  2. Extract the sample into the Liberty installation by running the command below from the root of your server installation:
    java -jar SpringSample.jar

Any missing features required by the server will need to be installed separately.

Running The Application

  1. Start the SpringSample server by running the command 'bin/server run SpringSample' from the root of the Liberty profile installation, and confirm the application started by looking in the console output:
    CWWKZ0001I: Application PhoneBookBySpringMVC started in XX.XX seconds.
  2. In your browser, enter the URL for the application: http://localhost:9111/PhoneBookBySpringMVC/ (where port 9111 assumes the httpEndpoint provided in the sample server.xml has not been modified).
  3. In your browser, you should see the phone book displayed.

Notes

This sample does not include the open source dependencies. The installer will provide a list of the open source pre-requisite libraries and where they can be downloaded from. To help obtaining these libraries, the installer provides the option to download them on your behalf.

Sample Structure

  • wlp
    • usr
      • servers
        • SpringSample
          • Copyright.txt
          • apps
            • PhoneBookBySpringMVC-1.0.0.war
          • lafiles
            • LA_en
            • LI_en
          • readme.html
          • server.xml
      • shared
        • config
          • SpringSampleLibs.xml
        • resources
          • SpringSampleLibs
            • aopalliance-1.0.jar
            • aspectjrt-1.7.1.jar
            • javax.inject-1.jar
            • jcl-over-slf4j-1.7.2.jar
            • jstl-1.2.jar
            • log4j-1.2.17.jar
            • slf4j-api-1.7.2.jar
            • slf4j-log4j12-1.7.2.jar
            • spring-aop-3.2.1.RELEASE.jar
            • spring-beans-3.2.1.RELEASE.jar
            • spring-context-3.2.1.RELEASE.jar
            • spring-core-3.2.1.RELEASE.jar
            • spring-expression-3.2.1.RELEASE.jar
            • spring-web-3.2.1.RELEASE.jar
            • spring-webmvc-3.2.1.RELEASE.jar