강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

Cho Seong Yong님의 프로필 이미지
Cho Seong Yong

작성한 질문수

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

프로젝트 생성

index.html 말고 다른 html파일을 처음에 보여주도록 할 수 있나요?

작성

·

800

0

강의에서는 localhost:8080을 입력했을때
index.html이 출력되는데 혹시 여러 html파일들이 있을 경우
localhost:8080으로 입력했을때 다른 html 화면이 출력되려면 어떻게 해야 할까요?

퀴즈

When creating dynamic web pages with Spring MVC, what are the key dependency combinations needed for basic web features and HTML template processing? The key dependencies typically include: * `spring-boot-starter-web` (for core web capabilities) * A template engine starter like `spring-boot-starter-thymeleaf` (for HTML templating)

Web, H2

Web, Thymeleaf

JPA, Lombok

Test, Web

답변 1

1

안녕하세요. Cho Seong Yong님, 공식 서포터즈 OMG입니다.

아래와 같이 루트 요청에 대하여 새로운 페이지로 이동하도록 설정할 수 있습니다.

"newPage"에는 이동할 html 명을 작성해주세요

@GetMapping("/")
public String sample() {
return "newPage";
}


감사합니다.

알려주셔서 감사합니다!

Cho Seong Yong님의 프로필 이미지
Cho Seong Yong

작성한 질문수

질문하기