JavaEE 의 환경에서 프로그램 실행 도중 필요한 경로


주요 함수

request.getContextPath()
.getServletPath()

.getRequestURI()
.getRequestURL()
.getPathInfo()

.getParameterMap()
.getParameter()
.ParameterNames()

.getQueryString()


톰캣 버전에 따른 변화


.getRequestURI() & .getRequestURL()

version < 5.5.7

최초 호출 url과 관련된 경로 반환

version >= 5.5.7

프로그램 실행 지점이 호출된 url 과 관련된 경로 반환.

최초 호출과 관련된 것들은

.getAttribute( ... )를 통해 얻으며 키 값은 다음과 같다:

  • forward (서블릿 2.4)
    • javax.servlet.forward.request_uri
    • javax.servlet.forward.context_path
    • javax.servlet.forward.servlet_path
    • javax.servlet.forward.path_info
    • javax.servlet.forward.query_string
  • include (서블릿 2.2)
    • javax.servlet.include.request_uri
    • javax.servlet.include.context_path
    • javax.servlet.include.servlet_path
    • javax.servlet.include.path_info
    • javax.servlet.include.query_string



'Java > JSP & Servlet' 카테고리의 다른 글

서블릿 이벤트 (Event & Listner in Servlet)  (0) 2017.05.09
WAS 관련 개념  (0) 2016.12.02
Jsp & Servlet 개발환경 설정  (0) 2016.12.02
Posted by 후니코드

블로그 이미지
개념적으로는 컴퓨터 프로그래밍을, 우선적으로는 Java와 관련하여 기본 사항을 소개.
후니코드

공지사항

Yesterday
Today
Total

달력

 « |  » 2025.6
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함