Woodstock, Glassfish and Seam
I have been playing around with seam and woodstock. One of the things i wanted to do was run seam on glassfish. Glassfish is one of the first containers to be JavaEE 5 compliant and IMO its neat.. . The best JavaEE containers that you can find in the market today.(I have nothing against the JBoss container.. but it just doesnt appeal
to me.. glassfish seems much more faster and simpler to use) And of course i dont think i need to say much about woodstock.. I have already blogged a lot about it 
Being a complete newbie.. the first thing i intended to do was start out with seam. This blog entry describes what i did. (sort of an idiot's guide to installing seam).
The next thing was to pick out the simplest of examples that seam provides you and port it to glassfish. The seam installation, does provide a default glassfish compliant application(hotel booking) that you can deploy and try it out.. But whats the fun in using something thats already given to me ready made.. The simplest that i could find was the registration example. This blog from Michael Yuan single handedly made my transition from JBoss container to glassfish completely painless.. You could also refer to Roger Kitan's and Brian Leonard's blogs.
You can take a look at Michael Yuan's blog to see how to port the application to glassfish. Since its all mentioned there clearly, i dont want to mention them here again. It mostly involves including some jars and making property file changes. (and of course using hibernate JPA instead of toplink essentials)
The only extra thing i needed to do was to have a mandatory import.sql file which inserted some dummy users into the data base.
The next thing to be done was to port the application to use woodstock components in the application instead of the JSF RI components. I am not a master with facelets and i didnt want to spend time right now to configure woodstock to use facelets.(hmmm.. sometime later.. not now..)
So, the next simplest thing i did was to create a jsp page which used woodstock components.. Here is how the sample jsp page looks.
Great.. Now all thats left is including the necessary jars for woodstock components to work. The simplest way again for now is to take the jars present in the example app war that you find in the woodstock site.
I modified the build.xml found for the registration example app so that it included the necessary jar files. Here is what my build.xml included. I took out all the woodstock jars and put them inside a "woodstock" directory inside the examples directory of seam. (this would be helpful if i later experimented with other seam examples)
Next make sure your faces-config.xml has your facelet configuration parameter commented out. Also, make sure your web.xml is modified for woodstock components. Again, here is how mine looks like..
Now we are all set.. Compile your own modified registration application and make sure everything is built fine. Importantly make sure the woodstock and its dependent jars are included in the generated "ear" file.
Next just go ahead and deploy this application in glassfish. Here is how my registration application looks like.


Just what i want to do, use seam with glassfish and woodstok, a good point to start. Very interesting
Posted by david on December 04, 2007 at 04:03 PM IST #
Hi,
I have any problems to start with this sample, when I launch register.xhtml I receive a blank page, where is the problem?
Thanks
Posted by Ted on January 06, 2008 at 11:03 PM IST #
Hi Ted,
Do you have the application server logs with you? It will help in pointing out the problem.
Posted by Venky on January 09, 2008 at 05:36 PM IST #
I opened server.log, but no error appears, in your application index.jsp with "hello world" sentence is default page, right?
Posted by Ted on January 10, 2008 at 11:44 PM IST #
Not sure which application you are talking about. The app described in the blog entry above does not have any "hello world" in its application. But if you create an application in netbeans, there is a default index.jsp which gets automatically generated. You can delete it if you want to. The above application modifies the standard seam application which contains a couple of registration pages there is no "hello world" page.
Posted by Venky on January 11, 2008 at 03:58 PM IST #
Sorry, I will talk about http://blogs.sun.com/venky/entry/developing_seam_application_with_woodstock.
Posted by Ted on January 12, 2008 at 08:38 PM IST #
Hi Ted,
Even in that the register.xhtml is the first page.Please take a look at the comments in that entry. They could help you solve your problem.
Posted by Venky on January 22, 2008 at 08:58 PM IST #