uCosminexus Application Server, Application Development Guide

[Contents][Glossary][Index][Back][Next]

Appendix L.1 Using JSF

If you are developing J2EE applications by using JSF, you must set the user, library, and facet.

The flow of required operations when using JSF is as follows:

Figure L-1 Flow of required operations when using JSF

[Figure]

This section gives an overview of the respective operations.

  1. Setting the user library
    You must set the user library for using JSF. For details, see (1) Setting up the user library.
  2. Setting the facet
    Set up the facet. For details, see (2) Setting up the facet.
  3. Setting required when using JSF 2.1
    If "2.1" is specified as the JSF version while setting up the facet, additional procedures are required. For details, see (3) Settings required when using JSF 2.1.

The setup procedures are as follows:

Organization of this subsection
(1) Setting up the user library
(2) Setting up the facet
(3) Settings required when using JSF 2.1
(4) Notes on editing web.xml

(1) Setting up the user library

To set up the user library:

  1. From the Eclipse menu bar, choose Window - Preferences.
    The Preferences dialog box appears.
  2. In the left pane of the Setting dialog box, choose Java - Build path - User Libraries.
    The User Libraries page appears.

    [Figure]

  3. Click the New button.
    The New User Library dialog box appears.

    [Figure]

  4. Specify any name in the User library name, and then click the OK button.
    The user library created in Defined user library appears.
  5. Select user library created in Defined user library, and then click the Add JARs button.
    The Select JAR dialog box appears.
  6. In the Select JAR dialog box, specify the jar to be added to file name, and then click the Open button.
    The jar specified in created user library is added.
    The jars to be added to the user library are as follows:
    • Developer-installation-directory\CC\lib\cjsf.jar
    • Developer-installation-directory\CC\lib\cjstl.jar
    • Developer-installation-directory\CC\lib\validation-api.jar
  7. In the Setting dialog box, click the OK button.
    The settings are saved.
    Note
    In the debug environment, if you want to execute a J2EE application that uses JSF, J2EE server side settings are required for the following jars:
    • Developer-installation-directory\CC\lib\cjsf.jar
    • Developer-installation-directory\CC\lib\cjstl.jar
    For details on settings, see 3.4 Settings of the class path (Setting up the development environment) in the uCosminexus Application Server Web Container Functionality Guide.

(2) Setting up the facet

To set the facet:

  1. In the Project Explorer view, choose the dynamic Web project using JSF.
  2. From the Eclipse menu bar, choose Project - Property.
    The Property: Project-name dialog box appears.
  3. In the left pane of the Property: Project-name dialog box, choose Project Facets.
    The Project Facets page appears.

    [Figure]

  4. In the Project Facets page, check JavaServer Faces and then choose "2.0" or "2.1" in the version.
    On the Project Facet page, the Further configuration required link or the Further configuration available link is displayed.
    If "2.1" is specified in version, additional procedures are required after setting up the facet. For details on additional procedures, see (3) Settings required when using JSF 2.1.

    [Figure]

  5. Click the link displayed in step 4.
    The Modify Faceted Project dialog box appears.

    [Figure]

  6. In the Modify Faceted Project dialog box, specify the following items:
    • Select User Library from Type.
    • In the displayed user library list, check the user library of the created JSF.
    • Deselect Include libraries with this application.
  7. Click the OK button.
  8. In the Property: Project-Name dialog box, click the OK button.

(3) Settings required when using JSF 2.1

The additional steps when using JSF 2.1 are as follows:

  1. Open faces-config.xml in editor.
  2. Change the version.
    Change the following items:
    • Change the version attributes of <faces-config> tag from "2.0" to "2.1".
    • Change the schema file name of xsi:schemaLocation attribute from web-facesconfig_2_0.xsd to web-facesconfig_2_1.xsd
  3. Add when using the elements added to JSF 2.1.
    Add the elements added to JSF 2.1.
    In an environment where internet connection is available, you can add elements using content assist in the Source tag or Outline view.

(4) Notes on editing web.xml

If you are performing the settings to use JSF, the following definitions are set in web.xml. Modify or delete the definitions.