Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.59 KB

File metadata and controls

29 lines (24 loc) · 1.59 KB

wicket-spring-hibernate

A dumb application based on the wicket archetype using wicket spring injection, spring transaction management, hibernate5, jpa entity manager.

configuration

  • SpringListener: a web listener configured to create a spring context using org.example.app.Context as it's configuration
  • ExampleFilter: a web filter that extends wicket filter, configured to use org.example.app.WicketApplication as the application class
  • Context:
    • loads application.properties from the classpath as a property source
    • creates entity manager factory and transaction manager
    • enables spring transaction management
    • enables jpa transaction processing using PersistenceAnnotationBeanPostProcessor
  • WicketApplication: sets homepage and adds a component instantiation listener that can do spring injection into wicket components
  • HomePage: uses SpringBean annotation to wire in bean from the spring context
  • Service: @Transactional annotations on methods to open and close transactions on entry/exit
  • persistence.xml: defines JPA persistence unit

extra dependencies

  • wicket-spring
  • spring-web
  • spring-orm
  • hibernate-core
  • servlet-api
  • h2 (in memory database)

running it

mvn jetty:run will start it on port 8080