fix: use banners correctly
This commit is contained in:
@ -29,22 +29,30 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.owasp.webgoat.container.WebGoat;
|
||||
import org.owasp.webgoat.webwolf.WebWolf;
|
||||
import org.springframework.boot.Banner;
|
||||
import org.springframework.boot.ResourceBanner;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
@Slf4j
|
||||
public class StartWebGoat {
|
||||
|
||||
public static void main(String[] args) {
|
||||
var parentBuilder =
|
||||
new SpringApplicationBuilder()
|
||||
.parent(ParentConfig.class)
|
||||
.web(WebApplicationType.NONE)
|
||||
.bannerMode(Banner.Mode.OFF);
|
||||
parentBuilder.child(WebWolf.class).web(WebApplicationType.SERVLET).run(args);
|
||||
new SpringApplicationBuilder().parent(ParentConfig.class).web(WebApplicationType.NONE);
|
||||
parentBuilder
|
||||
.child(WebWolf.class)
|
||||
.banner(new ResourceBanner(new ClassPathResource("banner-webwolf.txt")))
|
||||
.web(WebApplicationType.SERVLET)
|
||||
.run(args);
|
||||
|
||||
ApplicationContext webGoatContext =
|
||||
parentBuilder.child(WebGoat.class).web(WebApplicationType.SERVLET).run(args);
|
||||
parentBuilder
|
||||
.child(WebGoat.class)
|
||||
.banner(new ResourceBanner(new ClassPathResource("banner-webgoat.txt")))
|
||||
.web(WebApplicationType.SERVLET)
|
||||
.run(args);
|
||||
|
||||
printStartUpMessage(webGoatContext);
|
||||
}
|
||||
|
Reference in New Issue
Block a user