Version 19


    Step 6 of 8 - Previous | Next


    Step 6 - Generate/Deploy a Blank Seam Application Using seam-gen


    You will repeat some Step 4 items, but this time we will create an empty project, then generate a single facelet that posts to a SFSB.




    Specify a project name of "blank".



    Don't change the J2EE support level from 1.4, even though the project will be a Java EE 5 EAR file not a J2EE 1.4 EAR file. Seam gen will change the descriptors appropriately and eclipse will not complain.



    Add a "New Module...", and select the "EJB module" and "Web module", but DO NOT CHANGE THE NAMES. Seam gen will leverage eclipse' project naming conventions when generating code.



    Eclipse will make you accept yet another license agreement, then you be asked to associate the project with the "J2EE Perspective". You should accept the perspective suggestion.


    To generage the code needed to populate your new project, type "seam new-wtp-project blank". This will create an empty app that contains a working facelet.



    We'd also like to create a new SFSB action and a new facelet action page. To do this, type "seam new-action blank MySfsb"



    Next, we will generate the facelet by typing, "seam new-action-page blank my-action-page MySfsb". This will create a new facelet that submits to the newly created SFSB action.



    Now, you've got a working Seam project in Eclipse that works with WTP. We just have a few more things to do before we can run this application. First, we must fix the project's build path in eclipse. But, before we do that, let's go ahead and refresh our workspace in eclipse.



    Next, we need to fix the build path in "blankEJB". Since we generated the code outside of eclipse, we need to setup the project build path and library dependencies.



    Click the "Libraries" tab, then the "Add JARs..." button. Select all of the JARs in "blank/lib".



    The new "blank" application needs to be added to the JBoss server.




    Now, open up a browser and go to: http://localhost:8080/blank/my-action-page.seam.



    The blank app should now work and you should see console output for your SFSB when you hit the "Submit" button.



    Tips and Additional Reference Material

    • If for some reason, you want to re-do "seam set-properties", you must first delete "" in your seam-gen directory. Otherwise seam-gen will not create a new file that contains key code-generation properties.

    • Refer to JBossSEAMGen for more info on all seam-gen tasks. The seam-gen scripts can also generate SLSBs, MDBs and entity beans.

    • Read the tutorial that explains the Seam demo applications and make changes to the source code if you like.

    • Read the rest of the Seam reference documentation.

                                                                                    Step 6 of 8 - Previous | Next