public class SpringViewProvider extends Object implements com.vaadin.navigator.ViewProvider
ViewProvider that fetches the views from the Spring application context. The views
must implement the View interface and be annotated with the VaadinView annotation.
Use like this:
@VaadinUI
public class MyUI extends UI {
@Autowired SpringViewProvider viewProvider;
protected void init(VaadinRequest vaadinRequest) {
Navigator navigator = new Navigator(this, this);
navigator.addProvider(viewProvider);
setNavigator(navigator);
// ...
}
}
View-based security can be provided by creating a Spring bean that implements the ViewProviderAccessDelegate interface.
It is also possible to se an 'Access Denied' view by using setAccessDeniedViewClass(Class).VaadinView,
Serialized Form| Constructor and Description |
|---|
SpringViewProvider(ApplicationContext applicationContext,
BeanDefinitionRegistry beanDefinitionRegistry) |
| Modifier and Type | Method and Description |
|---|---|
Class<? extends com.vaadin.navigator.View> |
getAccessDeniedViewClass()
Returns the class of the access denied view.
|
com.vaadin.navigator.View |
getView(String viewName) |
String |
getViewName(String viewAndParameters) |
void |
setAccessDeniedViewClass(Class<? extends com.vaadin.navigator.View> accessDeniedViewClass)
Sets the class of the access denied view.
|
@Autowired public SpringViewProvider(ApplicationContext applicationContext, BeanDefinitionRegistry beanDefinitionRegistry)
public Class<? extends com.vaadin.navigator.View> getAccessDeniedViewClass()
ViewProviderAccessDelegate
denies access to a view.null if not set.public void setAccessDeniedViewClass(Class<? extends com.vaadin.navigator.View> accessDeniedViewClass)
ViewProviderAccessDelegate
denies access to a view.accessDeniedViewClass - the access denied view class, may be null.public String getViewName(String viewAndParameters)
getViewName in interface com.vaadin.navigator.ViewProviderpublic com.vaadin.navigator.View getView(String viewName)
getView in interface com.vaadin.navigator.ViewProviderCopyright © 2015. All rights reserved.