본문 바로가기
목차
Spring (boot) 오류 해결

[JAVA,JSP,SPRING] 현재 페이지의 url 주소 가져오기

by 지각생 2022. 2. 14.
728x90
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)
 
cs

https://dlevelb.tistory.com/576

 

[java] 현재 페이지의 url 주소 가져오기

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

dlevelb.tistory.com

 

728x90

댓글