JSecurity Spring/Hibernate sample application

Hi all,

I made a quick Spring/Hibernate sample application last night. After doing an SVN update, you'll see it in the samples/spring-hibernate directory. This directory has the format of an exploded .war.

I highly encourage everyone to check it out and look through the files. It has many best practices employed and convenient features like:

  • A good Entity base class for 'hibernated' POJOs
  • Hibernate *.hbm.xml mapping files for User/Role database relationships
  • A UserDAO using a nice base 'springified' HibernateDAO
  • A User domain object that also implements JSecurity's AuthorizingAccount interface, allowing your model object to support JSecurity realm operations
  • A corresponding JSecurity Realm implementation (called 'DefaultRealm') that shows you how to make JSecurity aware of your data model (trivial because User implements AuthorizingAccount)
  • Spring xml configuration pulling it all together (relatively small file)

The only thing this sample app does not have is a GUI/user interface. It just starts up successfully and nothing more, but I at least wanted everyone to get a feel of the steps required. Slapping on a GUI by adding a foo-servlet.xml Spring file is trivial afterwards - see the existing Spring (non Hibernate) sample app for an example of this.

Please feel free to ask any questions,

Cheers,

Les