views:

158

answers:

2

Hi, I'm looking for a step by step tutorial on building small web application using Wicket, Spring, JPA and Hibernate assuming that the programmer is advanced in java but new to those technologies (so if the whole set up was included that would be perfect). Could anyone help? Thanks in advance.

+1  A: 

I don't think all of that should be combined in one tutorial, as wicket shouldn't be aware of the database technology underneath. Let spring be the manager inbetween and deal independently with the model and view aspects:

a) Model: JPA / Hibernate is managed by Spring

b) View: Spring components are injected into wicket

For a) There are dozens of tutorials, and of course there's the spring JPA reference, which is pretty good.

For b) there is an ancient tutorial, most of which is still valid.

Basically, what you do is either

  1. have your wicket application managed by spring (dependency injection on application class) and store all Services and DAOs there or
  2. use SpringComponentInjector to inject spring dependencies into your wicket components.

(I favor the first approach)

seanizer
+1  A: 

I know this question has been closed but I thought I'd let you know that I once created a small project to help me remember how to do Wicket + Spring + Hibernate + JPA.

I didn't write any documentation (except comments), but dig through the web.xml, applicationContext.xml, one of the web pages (dependency injection with spring), WicketApplication and one of the models to see it in action.

Here's the SVN url if you are interested: http://forge.upbeat.no/svn-public/wicket-fun/trunk

The hibernate options specified in the src/main/filters/filters-DEV.properties file expects a postgresql database. You might want to change that to hsqldb or at least change the credentials if you want to take 'er for a spin.

John