source

스프링 부트: Spring Boot Servlet이니셜라이저는 권장되지 않습니다.

nicesource 2023. 4. 4. 21:25
반응형

스프링 부트: Spring Boot Servlet이니셜라이저는 권장되지 않습니다.

다음과 같이 JBoss에 Spring Boot 앱을 도입하려고 합니다.정상적으로 동작했지만 Spring Boot Servlet이니셜라이저는 1.4.0에서는 권장되지 않습니다.풀어주다.어떤 걸로 할까요?

메이븐 디펜시

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.0.RELEASE</version>
</parent>

자바 코드

 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.context.web.SpringBootServletInitializer;

    @SpringBootApplication
    public class DemoApplication  extends SpringBootServletInitializer {
        public static void main(String[] args) {
            SpringApplication.run(DemoApplication.class, args);
        }
    }

사용하고 있습니다.org.springframework.boot.context.web.SpringBootServletInitializer이것은 권장되지 않습니다.대신:

사용하다

org.springframework.boot.web.support.SpringBootServletInitializer

Spring Boot 2.0의 경우

org.springframework.boot.web.servlet.support.SpringBootServletInitializer

한 번 해봐도 돼. 날 위해 일했어.

import org.springframework.boot.web.servlet.ServletContextInitializer;

언급URL : https://stackoverflow.com/questions/38843015/spring-boot-springbootservletinitializer-is-deprecated

반응형