Hi All,
I am trying the new version of vaadin (have been using 6.8.9 all the time till now due to various reasons)
and am trying to use it with Spring Boot together with Apache Shiro.
And it kinds of work for me but I have one annoying problem.
This is a general setup:
Main and only UI
@SpringUI
@Theme(“myapp”)
@Widgetset(“org.adrian.myapp.core.AppWidgetSet”)
@Title(“MyApp”)
public class MainUI extends UI {
…
}
Application class:
@Configuration
@ComponentScan(value={“org.adrian.bookmarks”})
@EnableAutoConfiguration
@EnableSpringConfigured
@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)
@EnableLoadTimeWeaving(aspectjWeaving=AspectJWeaving.ENABLED)
public class Application extends SpringBootServletInitializer {
…
@Bean(name="shiroFilter")
public ShiroFilterFactoryBean shiroFilter() {
ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean();
shiroFilter.setLoginUrl("/login");
shiroFilter.setSuccessUrl("/");
Map<String, String> filterChainDefinitionMapping = new LinkedHashMap<String, String>();
filterChainDefinitionMapping.put("/login/**", "authc");
filterChainDefinitionMapping.put("/logout/", "noSessionCreation, logout");
filterChainDefinitionMapping.put("/resources/**", "anon");
filterChainDefinitionMapping.put("/**", "authc");
shiroFilter.setFilterChainDefinitionMap(filterChainDefinitionMapping);
shiroFilter.setSecurityManager(securityManager());
return shiroFilter;
}
}
and application.properties:
…
vaadin.servlet.urlMapping=/UI/*
…
and that works as expected BUT I end up with UI being appended in URL, eg:
http://localhost:8080/myapp/UI/
If I however remove the “vaadin.servlet.urlMapping=/UI/*” from application.properties
I am getting redirection loop error in a browser - for every header response with location
pointing to http://localhost:8080/myapp/login it keeps redirecting to the very same URL
and browser gives up with an error.
So I am making here some very basic error with my setup it seems but having dfficulties
in pointing to exactly which part it is responsible for …
Also - I noticed that with the Spring Boot integration it is SpringVaadinServlet not
a “normal” vaadin servlet being used so I guess that is another (or core) problem I am introducing …
Apart from that - I am using Spring DispatchServlet for login and logour pages, eg:
@Controller
public class LoginController {
@RequestMapping(value = "/login", method = {RequestMethod.GET, RequestMethod.POST})
public String login(HttpServletRequest request, ModelMap modelMap) {
.....
}
}
Any help ?
Thanks,
Adrian