Forward와 doFilter 설명

주어진 코드를 보면 isResourceUrl(path)의 결과에 따라 forward나 doFilter 중 하나를 호출하고 있습니다. 이 두 가지 메서드의 차이점과 역할에 대해 설명드리겠습니다.

Forward

doFilter

따라서 주어진 코드는 요청 경로가 리소스에 해당하면 forward를 통해 해당 경로로 요청을 전달하고, 그렇지 않으면 doFilter를 호출해 다음 필터 또는 서블릿으로 처리를 넘기는 것으로 보입니다.

Citations: [1] https://hyuuny.tistory.com/3 [2] https://stackoverflow.com/questions/45829496/dofilter-with-httpservletrequest [3] https://9keyyyy.tistory.com/15 [4] https://starkying.tistory.com/entry/Forward-그리고-Servlet-JSP의-연동 [5] https://www.digitalocean.com/community/tutorials/java-servlet-filter-example-tutorial [6] https://khr5830.tistory.com/171 [7] https://blogshine.tistory.com/21 [8] https://dev-handbook.tistory.com/35