Mojarra v2.1.20 Integration

This samples demonstrates the use of the Mojarra JSF implementation through a simple phonebook Web application deployed to Liberty.

This sample can be installed onto runtime versions and later.

Installation Instructions

Online installation (requires or later):

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

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

Offline installation:

  1. Download the MojarraSample.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 MojarraSample.jar

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

Running The Application

  1. Start the MojarraSample server by running the command 'bin/server run MojarraSample' from the root of the Liberty profile installation, and confirm the application started by looking in the console output:
    CWWKZ0001I: Application PhoneBookByMojarra started in XX.XX seconds.
  2. In your browser, enter the URL for the application: http://localhost:9106/PhoneBookByMojarra/ (where port 9106 assumes the httpEndpoint provided in the sample server.xml has not been modified).
  3. 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
        • MojarraSample
          • Copyright.txt
          • apps
            • PhoneBookByMojarra-1.0.0.war
              • WEB-INF
                • classes
                  • com
                    • ibm
                      • ws
                        • samples
                          • jsf
                            • bean
                              • PhoneBookBean.class
                              • PhoneBookEntry.class
                              • UserBean.class
                            • manager
                              • MockPhoneBookManager.class
                              • MockUserManager.class
                              • PhoneBookManager.class
                              • UserManager.class
                • lib
                  • jsf-api-2.1.20.jar
                  • jsf-impl-2.1.20.jar
                • web.xml
              • createUser.xhtml
              • default.xhtml
              • resources
                • css
                  • tableStyle.css
              • showPhoneBook.xhtml
              • showUsers.xhtml
          • lafiles
            • LA_en
            • LI_en
          • readme.html
          • server.xml