{TIL 18} Spring 오류해결 spring.mvc.pathmatch. matching-strategy=ant_path_matcher

YeilieY·2022년 10월 7일

항해99

목록 보기
23/27
post-thumbnail

ERROR: spring.mvc.pathmatch.matching-strategy=ant_path_matcher


{ 오류 로그 }

APPLICATION FAILED TO START

Description:

Invalid mapping pattern detected: /articles/{article.id}/edit
                  ^
Char '.' is not allowed in a captured variable name

Action:

Fix this pattern in your application or switch to the legacy 
parser implementation with 'spring.mvc.pathmatch.
matching-strategy=ant_path_matcher'.


Process finished with exit code 1

{ 원인 }

SpringBoot 를 2.6 이상 버전으로 업그레이드 되어있을 시 요청 경로를 
ControllerHandler 에 매칭시키기 위한 것이 작동된다.
조금 더 자세하게 설명해보면, 
spring.mvc.pathmatch.matching-strategy 기본 값이 ant_path_matcher 
에서 path_pattern_parser 로 변경이 된다.

{ 해결 방법 }

application.properties 파일에 가서 

spring.mvc.pathmatch.matching-	strategy=ant_path_matcher
을 입력한다.
profile
Fun_Dev

0개의 댓글