Java EE SDK Runs Seam
Posted by rogerk on April 28, 2006 at 2:30 PM EDT
Prerequisites:
- A working build environment with ant, at least JDK 5, and GlassFish (build 43 or later).
- For this application, you will also need to make sure you have the compatable Hibernate libraries with GlassFish:
- Download and install Hibernate3 3.2cr1 or later.
- Download and install Hibernate EntityManager 3.1 beta7 or later.
- Copy the required hibernate jars into Glassfish lib dir. The script here contains the list of jars.
- Edit the script to make sure it references your Glassfish and Hibernate install directories.
- Execute the script.
- Download and install the Seam 1.0beta2 release from here. You should see a jboss-seam-1.0beta2 directory.
- Get the zip files: seam-core-patch.zip
and seam-booking-patch.zip
.
- Go to the jboss-seam-1.0beta2 directory and unzip seam-core-patch.zip and seam-booking-patch.zip.
- Copy <glassfish install dir>/lib/javaee.jar to jboss-seam-1.0beta2/lib directory.
- Copy jboss-seam-1.0beta2/lib/jboss-common.jar <glassfish install dir>/lib
(needed for JBoss Logger)
- Compile Seam core classes:
- Create an empty jboss-seam-1.0beta2/src/test directory (the
build file is looking for this directory that is not there from the
seam zip file).
- Go to jboss-seam-1.0beta2 directory; ant;
- Compile Seam Booking Application:
- Copy jboss-seam-1.0beta2/jboss-seam-ui.jar to jboss-seam-1.0beta2/examples/booking/resources/WEB-INF/lib
- Go to jboss-seam-1.0beta2/examples/booking
- ant
- Start up Glassfish.
- Start the database: <glassfish install dir>/bin/asadmin start-database
- Deploy jboss-seam-1.0beta2/examples/booking/build/jboss-seam-booking.ear
- Visit localhost:8080/seam-booking
Core classes:
src/main/org/jboss/seam/Component.java
src/main/org/jboss/seam/ejb/SeamInterceptor.java
src/main/org/jboss/seam/interceptors/BijectionInterceptor.java
src/main/org/jboss/seam/interceptors/BusinessProcessInterceptor.java
src/main/org/jboss/seam/interceptors/ConversationInterceptor.java
src/main/org/jboss/seam/interceptors/Interceptor.java
src/main/org/jboss/seam/interceptors/JavaBeanInterceptor.java
src/main/org/jboss/seam/interceptors/OutcomeInterceptor.java
src/main/org/jboss/seam/interceptors/RemoveInterceptor.java
src/main/org/jboss/seam/interceptors/RollbackInterceptor.java
src/main/org/jboss/seam/interceptors/SeamInvocationContext.java
src/main/org/jboss/seam/interceptors/ValidationInterceptor.java
----> interceptor package changes described above
src/main/org/jboss/seam/jsf/SeamPhaseListener.java
----> moved initilialization of SeamVariableResolver, SeamNavigationHandler, SeamStateManager to
faces-config.xml, so they get created at startup.
src/main/org/jboss/seam/jsf/SeamStateManager.java
----> new class taken from StateManagerInterceptor class in SeamPhaseListener
src/main/META-INF/faces-config.xml
----> defines SeamVariableResolver, SeamNavigationHandler, SeamStateManager
----> modified component definition for HtmlQueryTable
src/main/org/jboss/seam/mock/MockServletContext.java
----> stubbed in public String getContextPath() method
Booking Application Modules:
examples/booking/resources/import.sql
examples/booking/resources/META-INF/persistence.xml
----> updated for application with GlassFish
examples/booking/resources/WEB-INF/web.xml
----> reference 2.5 schema, etc..
----> modified JNDI name pattern for EJB lookups
----> disabled MyFaces StartupServletContextListener (not compatable with JSF 1.2)
----> added <ejb-local-ref> elements for EJB modules
examples/booking/src/org/jboss/seam/example/booking/BookingListAction.java
examples/booking/src/org/jboss/seam/example/booking/ChangePasswordAction.java
examples/booking/src/org/jboss/seam/example/booking/HotelBookingAction.java
examples/booking/src/org/jboss/seam/example/booking/LoggedInInterceptor.java
examples/booking/src/org/jboss/seam/example/booking/LoggedIn.java
examples/booking/src/org/jboss/seam/example/booking/LoginAction.java
examples/booking/src/org/jboss/seam/example/booking/LogoutAction.java
examples/booking/src/org/jboss/seam/example/booking/RegisterAction.java
----> interceptor package changes described above
examples/booking/src/org/jboss/seam/example/booking/User.java
----> create "Users" table and reference it as "user" (User is reserved in javaee5)
examples/booking/view/main.xhtml
examples/booking/view/template.xhtml
----> added missing JSF "form" tags
Blog Links >>
- Login or register to post comments
- Printer-friendly version
- rogerk's blog
- 1637 reads





