• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

localhost:8080/hello시 whitelabel error 발생

23.03.01 18:32 작성 조회수 566

0

localhost:8080/hello 로 접속할시 whitelabel error 발생합니다!

@ServletComponentScan 붙이고

war인것도 확인했지만

콘솔에도 찍히지 않는 상황입니다!

어떤곳이 문제인지 잘 모르겠습니다ㅠㅠ

현재 helloServlet과 ServletApplication의 상태입니다!

package hello.servlet.basic;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet(name = "helloServlet", urlPatterns = "/hello")
public class HelloServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("HelloServlet.service");
    }
}
package hello.servlet;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;

@ServletComponentScan //서블릿 자동 등록
@SpringBootApplication
public class ServletApplication {

   public static void main(String[] args) {
      SpringApplication.run(ServletApplication.class, args);
   }

}

현재 폴더 구조입니다!

답변 2

·

답변을 작성해보세요.

0

sdk를 17로 쓰고있었는데 correto-11로 변경하니깐 해결되었습니다!

0

OMG님의 프로필

OMG

2023.03.01

안녕하세요. ParkHyunSeo님, 공식 서포터즈 OMG입니다.
다음 링크의 제 답변에서 제공하는 프로젝트를 다운받아 확인해보시겠어요?

동일한 증상이 발생할 경우 댓글 남겨주세요.

감사합니다.

프로젝트를 다운받아도 똑같은 증상이 발생합니다ㅠㅠ

 

https://www.inflearn.com/questions/801797/localhost-8080-hello-white-label 저도 이분과 동일한 현상으로 보여집니다!