Dev/JAVA - Web Develope

Request url, uri 관련 메소드

Fehoon- 2018. 7. 4. 19:21

출처 : http://dlevelb.tistory.com/576


1
2
3
4
5
6
7
아래와 같은 주소가 있을 경우
http://localhost:8080/test/index.jsp
 
request.getRequestURI();   //프로젝트경로부터 파일까지의 경로값을 얻어옴 (/test/index.jsp)
request.getContextPath();  //프로젝트의 경로값만 가져옴(/test)
request.getRequestURL();   //전체 경로를 가져옴 (http://localhost:8080/test/index.jsp)
request.getServletPath();  //파일명 (/index.jsp)


반응형

'Dev > JAVA - Web Develope' 카테고리의 다른 글

POJO & EJB?  (0) 2018.02.01
웹 개발 - 필터 API (Filter API)  (0) 2018.01.29