Front/JSP

[JSP] getContextPath 사용방법

AlexHouse 2022. 11. 29. 12:51
728x90

 

생각보다 간략하게 사용 할 수 있다.

 

 


method

 

시작하기 버튼을 눌럿을 때

 

넘어가도록 해보겠습니다. 

 

 

 

 

 

 

현재 메인 페이지가

 

 

localhsot:9090/o2.platform/

 

 

라고 한다면

 

<%=request.getContextPath()%> = localhost:9090/o2.platform/ 

 

인 상태 인것이다.

 

<%=request.getContextPath()%>/tutorial = localhsot:9090/o2.platform/tutorial/

 

다음과 같이 /tutorial을 포함시키면

 

이런식으로 사용 되는것을 알 수 있다.

 

 

 

 

이런식으로 페이지가 이동하게 된다.

 


 

To be continue..

728x90

'Front > JSP' 카테고리의 다른 글

[JSP] JSP에서 데이터를 가져오는 여러가지 방법  (0) 2022.11.29