Programming Language/Java
[Java] 현재 페이지 주소 정보 가져오기
HoZang
2019. 1. 2. 14:45
[Java] 현재 페이지 주소 정보 가져오기
현재 페이지 주소 : http://localhost:8080/project/path/index.jsp
request.getRequestURI(); // 요청경로 [ /project/path/index.jsp ] request.getContextPath(); // 프로젝트의 경로값만 가져옴 [ /project ] request.getRequestURL(); // 프로토콜, 호스트를 포함한 전체 요청경로 [ http://localhost:8080/project/path/index.jsp ] request.getServletPath(); // 파일 경로명 [ /path/index.jsp ]
도움이 되셨다면 공감이나 좋아요 부탁드립니다~♡
광고를 클릭해주시면 더욱 감사하구요~♡v♡/
혹시 더 궁금하신 점이나 부족한 부분, 잘못된 내용이 있다면 댓글 부탁드립니다~~