inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술

Hello 서블릿

localhost:8080/hello시 whitelabel error 발생

749

ParkHyunSeo

작성한 질문수 5

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);
   }

}

현재 폴더 구조입니다!

MVC spring

답변 2

0

ParkHyunSeo

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

0

OMG

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

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

감사합니다.

0

ParkHyunSeo

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

 

0

ParkHyunSeo

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

servlet과 container에 대한 질문입니다

0

25

1

api를 어느 컨트롤러에 작성해야하는지는 어떤 기준으로 해야하나요?

0

64

1

jsp 의존성 수정 요청

0

80

2

요즘 웹 서버가 주로 사용되는 이유는 SPA 구조 때문일까요 ?

0

143

1

save() 메서드 문의

0

67

1

절대 경로로 templates/basic 하위 파일 열면 css 적용 안되는 현상

0

101

1

request-body-json

0

83

2

MVC 패턴의 적용 단위

0

97

1

RequestMapping을 이용한 핸들러, 어댑터

0

119

2

save 후 결과화면

0

89

2

jsp를 이용한 view

0

97

1

application.properties에 debug 추가해도 결과가 똑같습니다.

0

178

1

수업 코드 제공 관련 문의

0

97

2

RequestMappingHandlerAdapter의 Controller 호출 과정

0

100

3

파일 오픈 시

0

70

1

스프링 배치 관련

0

78

1

@RequestParam의 defaultValue가 blank 값도 처리하는 지 여부

0

112

1

postman으로 /request-body-json-v1 호출시 500 error

0

96

1

프론트엔드와 백엔드의 mvc, rest api에 대한 질문

0

79

1

모델의 역할과 계층 분리에 대한 이해 차이 + 추가질문

0

111

1

console log 출력 관련 질문입니다.

0

75

1

애플리케이션이 실행 되지 않습니다 ㅠㅠㅠ

0

139

1

html 변경하는 부분 적용 문제

0

103

1

한글 깨짐

0

77

2