Martin Fey's SpringAwareModel / SpringBeanModel seem to be a pretty good solution to the whole Spring integration issue. [There might be lots more that can be done, but I'm not enough of an expert at Spring or Wicket to think of anything better.]

When I get a chance, I'll add some notes on the Wiki. But, in the meantime, I'll pass along hints for people trying to use it in real applications:


1) In most cases, you need to set some parameters on your model. But, your SpringAwareModel must be created by the SpringBeanModel. So, you'll want to use getNestedModel(). Something like:

SpringBeanModel springmodel = new SpringBeanModel(MySpringAwareModel.class);
MySpringAwareModel model = (MySpringAwareModel)springmodel.getNestedModel();
model.setFoo(bar);

2) Hibernate and Spring go really well together. You might be able to bind things with onBeginRequest(), etc, but I've been quite happy using Spring's OpenSessionInViewInterceptor. It uses AOP to set up the hibernate sessions completely transparently.

Your session is magically there...


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to