mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-07 17:59:02 +00:00
Add an accessor for webEnvironment to SpringApplication
Closes gh-6241
This commit is contained in:
committed by
Andy Wilkinson
parent
92bb24e365
commit
687199e688
@@ -928,6 +928,15 @@ public class SpringApplication {
|
||||
this.mainApplicationClass = mainApplicationClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this {@link SpringApplication} is running within a web environment.
|
||||
* @return {@code true} if running within a web environment, otherwise {@code false}.
|
||||
* @see #setWebEnvironment(boolean)
|
||||
*/
|
||||
public boolean isWebEnvironment() {
|
||||
return this.webEnvironment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if this application is running within a web environment. If not specified will
|
||||
* attempt to deduce the environment based on the classpath.
|
||||
|
||||
Reference in New Issue
Block a user