Directory

← Back

Spring Stuff

Makes Vaadin and Spring eternally happy together

Author

Rating

Popularity

<100

This add-on contains classes that add some missing "glue" between Vaadin and Spring. In addition, these classes help address the "scope mismatch" between Vaadin application scope and Spring web application context scope that leads to memory leaks when a Vaadin application closes.

Some key features included are:

  • A Spring application context for each Vaadin application
  • Autowiring of Vaadin and non-Vaadin beans
  • @VaadinConfigurable for autowire-on-construction
  • Helpers for background thread interaction with Vaadin application beans
  • A Spring scope that matches Vaadin application scope
  • Memory-leak free Vaadin listeners on non-Vaadin event sources
  • Several container and property helper classes
  • Auto-generation of container properties from annotations
  • Auto-generation of form fields from annotations

Sample code

<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- $Id$ -->
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:p="http://www.springframework.org/schema/p"
  xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">

    <!-- Activate Spring annotation support -->
    <context:annotation-config/>

    <!-- Example of an application-specific bean which gets created and autowired when the
           application starts and destroyed when the application stops -->
    <bean class="com.example.MyApplicationBean"/>

    <!-- This makse the Vaadin application instance itself available in, and autowired by, this context -->
    <bean class="org.dellroad.stuff.vaadin.ContextApplicationFactoryBean" p:autowire="true"/>

</beans>

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Version 1.0.659 Released April 9, 2013

- Update vaadin7 package for 7.0+
- Added VaadinApplication.invokeLater()
- Added AbstractUnsizedContainer
- Support Vaadin Touchkit and servlet 2.3 API (issue #18)
- Added VaadinUtil.assertSession()
Released
2013-04-09
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.2+
Vaadin 7.0+
Vaadin 7.1+ in 1.0.688
Browser
Browser Independent

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online