Project

General

Profile

task #5285

Updated by Andreas Kohlbecker about 7 years ago

Vaadin Spring Addon 


 The Vaadin Spring integration library helps you build amazing Vaadin based user interfaces on top of your high quality Spring based enterprise backend. Your UI classes become Spring managed beans, allowing you to autowire Spring based services directly into your UI code. 


 Links: 

 * [Vaadin Spring API](https://vaadin.com/api/vaadin-spring/) 
 * [**Vaadin [Vaadin Spring Tutorial**](http://vaadin.github.io/spring-tutorial/) Tutorial](http://vaadin.github.io/spring-tutorial/) 
   * [Example application](https://github.com/Vaadin/spring-tutorial) 
 * https://vaadin.com/wiki/-/wiki/Main/Spring%20Integration (on Vaadin 6) 
 * https://vaadin.com/wiki/-/wiki/Main/Vaadin+Spring 




 The features of Vaadin Spring include: 

 * First class support for Spring Boot 
 * Vaadin UI, View and component classes can be Spring managed beans and utilise the IoC container provided by Spring core 
 * @SpringUI annotated classes are automatically published, no need to manually introduce a servlet 
 * Vaadin Navigator support for View classes annotated with @SpringView 
  *Scopes for Vaadin UIs and Views 
 * Using the @Autowired annotation in Vaadin UI code 
 * Push support 

 **TODO**: 

 *THE BOOK OF VAADIN IS OUTDATED REGRADING VAADIN-SPRING!* 

 Therefore the below conclusions may not be up to date. 

 * Add `vaadin-spring` as maven dependency 
 * `CdmVaadinConversationalServlet`,    `StatusEditorUI`, `ConceptRelationshipUI`, `ConceptRelationshipUIRedirect`, `CheckTestUI`, `D3CTreeUI` which are exteding `VaadinServlet` must no longer be used or need to be modified (see *Book of Vaadin, 12.18.4. Preparing Application for Spring*) Since we need need **multiple servlets** with custom configuration see **Section 12.18.8, “Deploying Spring UIs and Servlets”** is important for us 
   * The inner `VaadinServlet` classes of the UI Classes can be replaced by the annotation `@SpringUI(path="/myPath")`  
 * The `@Scope` annotation at the `DetailWindow` must be replaced by `@ViewScope` or by `@UIScope` if this annotation is really still relevant. 
 * A couple of Views are evaluating the Spring Security Context. These classes are using the static method `SecurityContextHolder.getContext()` to get the context. This can most probably be replaced by `ViewAccessControl` or `ViewInstanceAccessControl`, which can restrict access to the view either 
 before or after a view instance is created. (See *Book of Vaadin 12.18.7. Access Control 
 *) 
 * Is the `CdmSpringContextHelper` still needed when using `vaadin-spring`? 
 


Back