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\

'개념정리' 카테고리의 다른 글

OGNL이란  (0) 2023.05.01
MYSQL workbench readonly상태 해제  (0) 2023.04.19
워크스페이스 에러  (0) 2023.04.04
HTTP  (0) 2023.04.04
Vector Hashtable VS Collections.synchronizedXxx()  (0) 2023.04.04

+ Recent posts