Finally had time to clean up and write down a few knowledge base articles for Seam. Some of these tricks have been very useful for building and running the Seam website. I still have leftovers, hopefully I can post another round of articles next week.
Here is the list for today, there should be something in there for anyone using Seam:
- Extending DBUnitSeamTest shows how you can extend the unit testing feature of Seam for mock data import. Examples are: adding support for PostgreSQL, writing custom DBUnit dataset operations (like calling a stored procedure before a test method runs) and configuration of DBUnit.
- Importing DBUnit datasets for development deployments explains how to use DBUnit during actual development, not only for unit testing. I found it very convenient to have the same mock data as I had available in unit testing imported automatically when deploying an application on my development machine. It helps you keeping interactive and automated testing in sync.
- Using MySQL in production with UTF8 wasn't as straightforward as I hoped it would be, I had to customize the Hibernate dialect, the JBoss AS datasource, and Tomcat. This recipe summarizes all the changes.
- Automatically extending session timeout for authenticated users is a good idea and if you also have anonymous and authenticated users on your Seam application, I recommend you implement the same pattern.
- Removing JSESSIONID from your URLs (and fixing s:cache) was a problem that actually only hit me in staging and I almost rolled it out without noticing. If you use the Seam HTML fragment cache, you need to read this. Unfortunately, there is nothing we can do in Seam to fix this.
- Drop-down boxes with entities and page scope describes my favorite JSF misfeature, or how the good intentions of the specification have been destroyed by a bad reference implementation. It's very hard to have drop-down box in JSF with a list of products or customers. Seam makes it easy out of the box if you can also use a long-running conversation context. My solution is a bit of a hack, but it makes it easy without the conversation context, just the page context.
Post improvements directly on the pages please, they are editable for all Seam community members.