Annotation Interface SpringView


Annotation to be placed on View-classes that should be handled by the SpringViewProvider.

This annotation is also a stereotype annotation, so Spring will automatically detect the annotated classes. By default, this annotation also puts the view into the view scope. You can override this by using another scope annotation, such as the UI scope, on your view class. However, the singleton scope will not work!

This is an example of a view that is mapped to an empty view name and is available for all UI subclasses in the application:

 @SpringView(name = "")
 public class MyDefaultView extends CustomComponent implements View {
     // ...
 }
 
This is an example of a view that is only available to a specified UI subclass:
 @SpringView(name = "myView", ui = MyUI.class)
 public class MyView extends CustomComponent implements View {
     // ...
 }
 
Author:
Petter Holmström (petter@vaadin.com), Henri Sara (hesara@vaadin.com)
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The name of the view.
    Class<? extends com.vaadin.ui.UI>[]
    By default, the view will be available for all UI subclasses in the application.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    USE_CONVENTIONS is treated as a special case that will cause the automatic View mapping to occur.
  • Field Details

    • USE_CONVENTIONS

      static final String USE_CONVENTIONS
      USE_CONVENTIONS is treated as a special case that will cause the automatic View mapping to occur.
      See Also:
  • Element Details

    • name

      String name
      The name of the view. This is the name that is to be passed to the Navigator when navigating to the view. There can be multiple views with the same name as long as they belong to separate UI subclasses. If the default value USE_CONVENTIONS is used, the name of the view is derived from the class name so that e.g. UserDetailView becomes "user-detail". Although auto-generated view names are supported, using explicit naming of views is strongly recommended.
      See Also:
      Default:
      "USE CONVENTIONS"
    • ui

      Class<? extends com.vaadin.ui.UI>[] ui
      By default, the view will be available for all UI subclasses in the application. This attribute can be used to explicitly specify which subclass (or subclasses) that the view belongs to.
      Default:
      {}