getRequestURI()와 getContextPath()의 차이점은 다음과 같습니다:

  1. getRequestURI()
  1. getContextPath()

즉, getRequestURI()는 컨텍스트 경로와 서블릿 경로를 모두 포함하는 반면, getContextPath()는 컨텍스트 경로만 반환한다는 점이 가장 큰 차이점입니다.[1][4]

getRequestURI()에서 getContextPath()를 제거하면 순수한 서블릿 경로를 얻을 수 있습니다.[3]

Citations: [1] https://yonghwankim-dev.tistory.com/279 [2] https://hihoyeho.tistory.com/entry/HttpServletRequest-함수를-사용한-요청-URL-취득 [3] https://tnsgud.tistory.com/656 [4] https://finewoo.tistory.com/18 [5] https://back-end-developer.tistory.com/entry/Servlet-필터-Filter [6] https://kimfk567.tistory.com/7 [7] https://junhyunny.github.io/information/java/spring-boot/information-in-http-servlet-request/ [8] https://pathas.tistory.com/179