Skip to content

Commit

Permalink
Make VaadinServlet @ConditionalOnMissingBean (#18206)
Browse files Browse the repository at this point in the history
Change-Id: I6cf6bb5abc2ab7f53e542e96b67a39875988207d
  • Loading branch information
Teemu Suo-Anttila committed Aug 11, 2015
1 parent 9772a78 commit ef5ab45
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
Expand Down Expand Up @@ -57,7 +58,7 @@
* and path info on the fly as those produced by
* {@link ServletForwardingController} are not what {@link VaadinServlet}
* expects. See {@link SpringVaadinServlet} for more information on this.
*
*
* @author Petter Holmström ([email protected])
* @author Henri Sara ([email protected])
*/
Expand Down Expand Up @@ -132,7 +133,7 @@ protected Logger getLogger() {
/**
* Forwarding controller that sends requests for the root page of Vaadin
* servlets to the Vaadin servlet.
*
*
* @return forwarding controller
*/
@Bean
Expand All @@ -148,7 +149,7 @@ public Controller vaadinUiForwardingController() {
/**
* Returns true if the Vaadin servlet is mapped to the context root, false
* otherwise.
*
*
* @return true if the Vaadin servlet is mapped to the context root
*/
protected boolean isMappedToRoot() {
Expand Down Expand Up @@ -186,6 +187,7 @@ public void afterPropertiesSet() throws Exception {
}

@Bean
@ConditionalOnMissingBean
public VaadinServlet vaadinServlet() {
return new SpringVaadinServlet();
}
Expand Down

0 comments on commit ef5ab45

Please sign in to comment.