I can do it(Feat. DEV)

[Spring Boot]JSP 수정한 코드가 바로 적용 안될 때 본문

개발자 모드/응용

[Spring Boot]JSP 수정한 코드가 바로 적용 안될 때

까짓거 해보자 개발자 2023. 8. 31. 17:56
728x90

Spring Boot 프로젝트를 생성해 front 단을 jsp로 구성하려고 설정한 뒤

 

jsp 파일을 만들고 간단한 태그를 추가했는데

 

F5를 눌러도 변경되지 않는 것!!❓

 

보통 jsp는 서버를 끄고 재구동 시키지 않아도 바로 적용이 되었는데

 

필자는 왜 그런지 몰라 바~로 갓글에 검색

 

728x90

 

해결책

 

이유는 잘 모르겠으나 필자가 추측하기론 spring boot는 jsp 사용을 권장하지 않아서

 

뭔가 지원이 안되서 그런 것이 아닐까.. 하는 뇌지컬 추측을 해봄.

 

다시 돌아와 해결책은 pom.xml 에

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
    </dependency>

 

라이브러리를 추가한 뒤,

 

application.yml 파일에서 

 

spring:
  devtools:
    livereload:
      enabled: true

 

설정을 추가하면 끝!

 

설정한 뒤 maven reload 후 서버 재구동하면 바로 적용이 되는 것을 볼 수 있음👍

 

 

 

 

📢참조 사이트

 

https://sungsu9022.github.io/posts/devlog-spring-boot-tools/

 

Spring Boot JSP 자동 reload 되지 않는 문제 해결 방법

Spring Boot JSP 자동 reload 되지 않는 문제 해결 방법 내용 legacy Spring Project에서 Spring boot로 전환되었을때 즉시 발견할수 있는 문제중 하나는 IDE에서 jsp파일을 수정해도 auto reload되지 않는 문제입니

sungsu9022.github.io

https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.devtools.livereload

 

Developing with Spring Boot

This section goes into more detail about how you should use Spring Boot. It covers topics such as build systems, auto-configuration, and how to run your applications. We also cover some Spring Boot best practices. Although there is nothing particularly spe

docs.spring.io

 

728x90