투덜이 개발자

JSP에서 현재 경로 출력 본문

Program Language/JSP & JSTL

JSP에서 현재 경로 출력

엠투 2022. 10. 20. 10:14
반응형

JSP에서 현재 경로 출력

<div>
    <br>
        Server  : <%= application.getServerInfo()%>
    <br>
        Contect Path  : <%= request.getContextPath() %>
    <br>
        URL Path  : <%= request.getRequestURI()%>
    <br>
        Absolute Path  : <%= application.getRealPath("/")%>
    <br>
        현재 페이지의 URL  : <c:set var="url" value="${pageContext.request.requestURL}"/>${url}
    <br>
        현재 페이지의 URI  : <c:set var="uri" value="${pageContext.request.requestURI}"/>${uri}
    <br>
        현재 Path  : <c:set var="path" value="${requestScope['javax.servlet.forward.servlet_path']}"/>${path}
    <br>
        현재 URI  : <c:set var="realURL" value="${requestScope['javax.servlet.forward.request_uri']}"/>${realURL}
    <br>
    </ul>
</div>

 

Server : Apache Tomcat/8.5.82
Contect Path : /ex
URL Path : /ex/WEB-INF/views//item/list.jsp
Absolute Path : C:\Gmedia\MCMS\test.company.com\ex\src\main\webapp\
현재 페이지의 URL : http://localhost:8500/ex/WEB-INF/views//item/list.jsp
현재 페이지의 URI : /ex/WEB-INF/views//item/list.jsp
현재 Path : /itemList
현재 URI : /ex/itemList

 

반응형

'Program Language > JSP & JSTL' 카테고리의 다른 글

# <%@ include file="" %> <jsp:include> <c:import> 차이  (0) 2023.02.17
JSTL 에서 Java 함수 호출  (0) 2022.12.07
JSTL 비교 연산자  (0) 2022.11.10