Search |
||
A Conversation with SeamPosted by bleonard on November 15, 2006 at 10:51 AM PST
Another one of Seam's compelling features is its ability to manage "conversations". A Seam conversation provides fine grain control over the traditional HTTP session scope so that "concurrent conversations" can occur in HTTP session, which usually occur when users open another browser window or tab. The problem is best described with an example. I've added a confirmation page to the registration application used in my previous blog entries. So consider this application use case: I launch the application and enter my registration information:
And the Registration page takes me to a confirmation page:
However, rather than completing the transaction (or conversation), I open a new browser tab and decide to register my brother as well:
And click Register to load his confirmation page:
But before completing this 2nd transaction (conversation), I return back to the registration tab with my registration details and now decide to complete the original transaction (conversation):
Hmmm, not was I was expecting (actually, it was - but you know what I mean). Now for anyone who's done web application development, managing the HTTP Session for these scenarios can be a nightmare. Let's see how easily the Seam framework addresses this all too common problem. If you'd like to produce and fix this problem yourself, continue with the following Steps. If you just want to see the solution, jump to Step 3: Solving the Conversation Problem. Step 1: Getting the Goods
Step 2: Setting Up Your EnvironmentIn this first step, we'll set up the environment to run our Registration application. Add the JBoss Server to NetBeans
The Registration Project that we'll open in the next step references a class library called JBossSeam, which we'll now create using the 1.0.1 GA of Seam:
These libraries are now available for use by any project. Open the Registration ProjectThe Registration application is a NetBeans Enterprise Application Project, which is actually comprised of 3 projects: Registration, Registration-EJBModule and Registration-WebModule. Registraiton-EJBModule and Registration-WebModule are Java EE Modules of the Registration project. Registration-EJBModule generates the EJB jar file. Registration-WebModule generates the war file and Registration generates the ear file which contains the jar and war.
Step 3: Solving the Conversation ProblemThe Registration application in the example is already using Seam, it's just not using the conversation feature. In this step, we'll make a few simple changes to our application which will solve the conversation problem outlined in the introduction.
»
Related Topics >>
J2EE Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|