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
'Spring (boot) 오류 해결' 카테고리의 다른 글
Invalid character found in the request target [/category?c={ ]. The valid characters are defined in RFC 7230 and RFC 3986 (0) | 2022.02.16 |
---|---|
"data": "For input string: \"/\"" (0) | 2022.02.16 |
$ajax 공부 (url 주소 보낼땐 시큐리티 조심!//$ajax 통신법은 숙지!) (0) | 2022.02.13 |
Lombok과 Json getter명명 규칙 (0) | 2022.02.12 |
json parse error unrecognized token (0) | 2022.02.11 |
댓글