Spring/SpringMVC v3.2.1 Integration


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


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

This sample can be installed onto runtime versions and later.


  1. Install the packaged server by typing ‘java -jar SpringSample.jar’ and following the instructions.
  2. When prompted, set the target to the “wlp” directory of your Liberty installation.
  3. 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.
  4. 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).
  5. In your browser, you should see the phone book displayed.


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 (copyright notice for this sample)
          • readme.html (these instructions)
          • server.xml (sample server using Spring shared library)
          • apps
            • PhoneBookBySpringMVC-1.0.0.war (sample Spring Web application)
      • shared
        • config
          • SpringSampleLibs.xml (shared library configuration for Spring)
        • resources
          • SpringSampleLibs (Spring and pre-requisite libraries – downloadable during installation)
  • Peer Törngren

    Took me a while to figure out what to answer when prompted for target directory in step 1; apparently, you want the installation folder of WAS? The phrase “packaged server” made me believe the file was somehow self-contained.

  • Samuel O’Donnell

    Hi Peer,

    Yes, the expected target is the wlp directory. I will update this doc to make it clearer.


    • kboo

      Hi Samuel,
      Also, the sample installation does not seem to work if Liberty was installed with IM.
      - Kihup