Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Start the eclipse wizard and right click on the Project Explorer and click on the New -> Dynamic Web Project
  2. Enter the project name as EmployeeWEB and click on the Next button.
  3. On the New Dynamic Web Project wizard, check on the Project Facet checkboxes and select the version values as below screen shot, and click on the Next button.
  4. On the Web Module wizard, make sure that Generate Deployment Descriptor is checked as below and click on the Next button.
  5. On the Geronimo Deployment Plan wizard, provide the moduleId values as below screen shot and click on the Next button.

  6. On the JSF Capabilities wizard, check the second radio button and click on the New button by the side of the combo box. This will open Create JSF Implementation Library wizard.
  7. Provide the Library Name as MyJSFLibrary and add the following jars by clicking on the Add button. Finally, click on the Finish button.
    • <geronimo_home>\repository\commons-beanutils\commons-beanutils\1.67.10\commons-beanutils-1.67.10.jar
    • <geronimo_home>\repository\commons-collections\commons-collections\3.12\commons-collections-3.12.jar
    • <geronimo_home>\repository\commons-digester\commons-digester\1.8\commons-digester-1.8.jar
    • <geronimo_home>\repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar
    • <geronimo_home>\repository\org\apache\myfaces\core\myfaces-api\1.2.26\myfaces-api-1.2.2.jar
    • <geronimo_home>\repository\org\apache\myfaces\core\myfaces-impl\1.2.26\myfaces-impl-1.2.2.jar
  8. Now, on the JSF Capabilities wizard, add the URL Mapping Patterns as *.jsf and click on the Finish button.

  9. This will create EmployeeWEB application in the Project Explorer as below screen shot.

  10. Right click on the WEB-INF folder and navigate to New -> Folder and create a folder by name tld as given in the screen shot below.

  11. Copy myfaces_core.tld and myfaces-html.tld files into the tld folder. These *.tld files are available in the myfaces-apiimpl-1.2.26.jar file.
  12. We are going to use JPA to connect to EmployeeDB database created in the embedded Derby database. JPA uses persistence.xml file for configuration. Create a META-INF folder in the EmployeeWEB -> build -> classes folder in the Project Explorer. The contents of the persistence.xml are as follows.
    Code Block
    XML
    XML
    borderStylesolid
    titlepersistence.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
     http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
    
     <persistence-unit name="Employee" transaction-type="JTA">  
      <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
      <non-jta-data-source>EmployeeDS</non-jta-data-source>
     </persistence-unit>
    	
    </persistence>
    
    

...