Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/serkan-ozal/vaadin-s4v

Spring for Vaadin
https://github.com/serkan-ozal/vaadin-s4v

Last synced: 15 days ago
JSON representation

Spring for Vaadin

Awesome Lists containing this project

README

        

What is vaadin-s4v?
==============

**vaadin-s4v** is a **Java Instrumentation API** based integration framework to connect Vaddin UI components with beans of Spring context. Demo application is at [https://github.com/serkan-ozal/vaadin-s4v-demo](https://github.com/serkan-ozal/vaadin-s4v-demo).

Usage
=======

To enable Vaadin and Spring integration automatically, there are three ways:

**1)** Import `context.xml` of **vaadin-s4v** in your `context.xml`.

~~~~~ xml
...

...
~~~~~

or

**2)** Automatically scan Spring beans of **vaadin-s4v** in your `context.xml`.

~~~~~ xml
...

...
~~~~~

or

**3)** Call explicitly integrating method at startup anywhere of your application.

~~~~~ java
...

com.vaadin.s4v.SpringIntegrator.integrateVaadinWithSpring();

...
~~~~~

And in any `com.vaadin.ui.Component` typed class, you can easily inject Spring beans in traditional way by using `@Autowired` annotation.

For example:

~~~~~ java
...

public class MyView extends VerticalLayout {

@Autowired
private SpringBean springBean;

...

}

...
~~~~~

If you have got an error like this

~~~~~ java
...

com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded

...
~~~~~

You must explicitly enable attach listener flag by `-XX:+StartAttachListener` as VM argument.
This error is caused by a bug of JVM on **MacOS** operating system.

Installation
=======

In your `pom.xml`, you must add repository and dependency for **vaadin-s4v**.
You can change `vaadin.s4v.version` to any existing **vaadin-s4v** library version.
Latest version is `1.0.0-SNAPSHOT`.

~~~~~ xml
...

...
1.0.0-SNAPSHOT
...

...

...

com.vaadin
vaadin-s4v
${vaadin.s4v.version}

...

...

...

serkanozal-maven-repository
https://github.com/serkan-ozal/maven-repository/raw/master/

...

...
~~~~~