2016. 12. 27. 09:41 Java/JSP & Servlet
Request 객체 요약
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 |