diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index 5aa88ba9cb..a008e45b2d 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -2157,6 +2157,50 @@ Boot application, and the guidance above might help, but your mileage may vary. +[[howto-weblogic]] +=== Deploying a WAR to Weblogic +To deploy a Spring Boot application to Weblogic you must ensure that your servlet +initializer *directly* implements `WebApplicationInitializer` (even if you extend from a +base class that already implements it). + +A typical initializer for Weblogic would be something like this: + +[source,java,indent=0,subs="verbatim,quotes,attributes"] +---- + import org.springframework.boot.autoconfigure.SpringBootApplication; + import org.springframework.boot.context.web.SpringBootServletInitializer; + import org.springframework.web.WebApplicationInitializer; + + @SpringBootApplication + public class MyApplication extends SpringBootServletInitializer implements WebApplicationInitializer { + + } +---- + +If you use logback, you will also need to tell Weblogic to prefer the packaged version +rather than the version that pre-installed with the server. You can do this by adding a +`WEB-INF/weblogic.xml` file with the following contents: + +[source,xml,indent=0] +---- + + + + + org.slf4j + + + +---- + + + [[howto-servlet-2-5]] === Deploying a WAR in an Old (Servlet 2.5) Container Spring Boot uses Servet 3.0 APIs to initialize the `ServletContext` (register `Servlets`