[seam-dev] Wicket Seam integration

Pete Muir pete.muir at jboss.org
Thu Feb 21 07:50:33 EST 2008


Hi Eelco, Frank

Apologies for being slow in getting back in contact with you.

If you take a look at Seam trunk (we did an alpha release as Seam  
2.1.0.A1) you can find my work on Seam-Wicket integration. I followed  
a slightly different approach to both of you ;-)

1) I used Eelco's approach to support injection (my backend code  
needs rewriting for this). The major issue I ran into here is that we  
need to "disinject" Seam components after the request as Seam manages  
their lifecycle, not Wicket. I currently don't have a good way of  
doing this, and am using a proxy to do a lookup on each call to Seam  
component (which is slow). I also corrected the logic so that it  
followed Seam standards (Seam doesn't do injection based on type).

2) I created a base SeamWebPage class for users to extend. This  
essentially sets up the Seam integration code, enables Seam Security,  
enables conversation propagation etc. We can probably try to factor  
out some this code into other integration points

3) Ported the booking example across to run on wicket rather than JSF  
(see examples/wicket in Seam distro)

4) Wrote integration for model based validation


My future ideas
----------------------

1) Improve integration code (including better way of doing injection)
2) Support outjection
3) Support annotations like @Begin, @End, @BeginTask, @EndTask,  
@RaiseEvent inside Wicket components (if you are familiar with Seam 
+JSF, this is what pages.xml does)
4) Finer grained Seam Security (currently @Restrict only works on the  
Page class)
5) Port another example
6) Support for "facesMessages" to transport messages from the  
business layer to the view layer

My major obstacle is lack of interceptors in Wicket (it makes it hard  
to hook into Wicket at the correct points) - any ideas? For example,  
it would be good to do

          add(new Link("cancel")
          {

             @Override
             @RaiseEvent("someEvent")
             public void onClick()
             {
                setResponsePage(Main.class);
             }

          });

But actually @RaiseEvent could go on any method.

Any thoughts?

Thanks,

Pete

--
Pete Muir
http://www.seamframework.org
http://in.relation.to/Bloggers/Pete







More information about the seam-dev mailing list