-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make VaadinServlet @ConditionalOnMissingBean (#18206)
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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]) | ||
*/ | ||
|
@@ -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 | ||
|
@@ -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() { | ||
|
@@ -186,6 +187,7 @@ public void afterPropertiesSet() throws Exception { | |
} | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public VaadinServlet vaadinServlet() { | ||
return new SpringVaadinServlet(); | ||
} | ||
|