Show TOC

Procedure documentationCreating the Development Components Locate this document in the navigation structure

 

This procedure describes how to create the necessary development component projects for the simple Java EE 5 application. There are four development components needed: EJB Module, Web Module, Enterprise Application, and Dictionary. The next sections describe how to enable the usage of Java Persistence (JPA) and JavaServer Faces (JSF) technologies when developing the application. Some of the development components (projects) need to be enabled with additional facets.

Procedure

  1. In your SAP NetWeaver Developer Studio, open the Java EE perspective.

  2. To create a new development component, choose   File   New   Other   Development infrastructure   Development Component   Next  .

  3. Specify the type and name of the development component by following the corresponding instructions:

    1. For EJB Module — choose  J2EE   EJB Module   Next   LocalDevelopment   MyComponents   Next  . Then enter the name app_ejb and choose Finish.

    2. For Web Module — choose   J2EE   Web Module   Next   LocalDevelopment   MyComponents   Next  . Then enter the name app_web and then Finish.

    3. For Enterprise Application — choose   J2EE   Enterprise Application   Next   LocalDevelopment   MyComponents   Next  . Then enter the name app_ear and choose Next, and then select the checkbox indicators for already existing EJB and Web development component projects and choose Finish.

      Now your Enterprise Application development component has valid references to EJB and Web development component projects.

    4. For Dictionary — choose   Dictionary   Next   LocalDevelopment   MyComponents   Next  . Then enter the name app_dict and choose Next then Finish.

Adding JPA Facets to the EJB Project
  1. From the context menu of the app_ejb (EJB project) choose   Properties   Project Facets   Modify Facets   Modify Project  .

  2. Select the Java Persistence checkbox indicator and choose Next.

  3. From the Platform dropdown menu select SAP implementation of JPA and choose Add connection.

  4. In the New Connection Profile window, choose Java Dictionary, then Next, enter the connection name app_conn, select the Auto-connect at startup indicator and choose Next.

  5. Browse to the dictionary project (app_dict) to which the connection is made and choose Finish.

  6. Choose Finish and then OK.

    Now you have created a relation between the EJB project containing the JPA entities, and the data dictionary project utilizing the forward mapping functionality of the toolset. This way you generate the database tables straight from the JPA entities.

Adding JSF Facets to Web Project
  1. From the context menu of the app_web (Web project) choose   Properties   Project Facets   Modify Facets   Modify Project  .

  2. Select the JavaServer Faces checkbox indicator, choose Next and then Finish.

  3. From the dropdown menu select JSF version 1.2.

  4. Select the Server Supplied JSF Implementation radio button.

  5. Choose Finish and then OK.

Adding Data Source Alias Facets to Enterprise Application (EAR) Project
  1. From the context menu of the app_ear (EAR project) choose   Properties   Project Facets   Modify Facets   Modify Project  .

  2. Select the SAP Data Source Aliases Provider Module checkbox indicator.

  3. Choose Finish and then OK.