Thursday, 8 February 2018

Vaadin Spring Annotations



@SpringComponent: it is an alias of @Component; for Vaadin has already defined a component interface in usage. It declares a Vaadin bean it can be injected from Spring IoC. 

@SpringUI: let the Vaadin Spring plugin know which UI's should be accessible to the user and how they should be mapped. It accepts one optional String parameter indicating the UI path. If an explicit path is not provided or an empty string is used as the path, the UI will be mapped to the context root.

@SpringView: annotating views, so as to be found by SpringViewProvider
@SpringViewDisplay: to define where in the UI the views are to be shown, a bean or a class implementing ViewDisplay or extending (Single)ComponentContainer should be annotated with @SpringviewDisplay.

Single Component Container:  Window, Panel, and UI.

@UIScope: an annotation is specific to Vaadin Spring. Getting the same instance within the same UI, but injecting different instance as in different UI.
@ViewScope: it makes a life cycle of this injected bean view specific.

@VaadinSessionScope: Objects in VaadinSeesionScope is unique, and shared between all UIs open in the session. This is the most basic scope in Vaadin applications, useful for accessing data for the user associated with the session.

Standard Spring scopes can be used with some restrictions. Most commonly,
@Scope("prototype") to inject a new instance every time that bean is injected. The following cannot be used for Vaadin Components.
@Scope("singleton") can be used for thread-safe background services, the request and session scope of Spring do not match exactly the Vaadin session and do not work in background threads such as in operations even when using Ui.access()


Reference
Vaadin Spring

No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...