춘핑이 2023. 4. 4. 13:11

Path

프로젝트 Path만 가져온다.
request.getContextPath()
예) http://localhost:8080/project/index.jsp -> /project

프로젝트 + 파일경로까지 가져온다
request.getRequestURI()
예) http://localhost:8080/project/index.jsp -> /project/index.jsp

전체 경로를 가져온다
request.getRequestURL()
예) http://localhost:8080/project/index.jsp -> http://localhost:8080/project/index.jsp

파일명만 가져온다.
request.ServletPath()
예) http://localhost:8080/project/index.jsp -> index.jsp

서버 로컬 웹 애플리케이션 절대경로를 가져온다
request.getRealPath()
예) http://localhost:8080/projectname/index.jsp -> c:\project\webapps\projectname\