WebLogic JSP Reference[Oracle]
JSP
에서 사용되는 JSP EL(Expression Language)
에는 사용할 수 있는 몇 가지 내장 객체들이 있다.
이러한 객체들은 아래 예시처럼 ${???}
형식으로 사용할 수 있다.
${pageContext.request.requestURI}
// 요청 URL, HttpServletRequest를 호출하여 가져온다.
${sessionScope.gillog}
// session-scoped의 attribute 중 gillog이라는 이름의 Value
// 발견되지 않으면 null
${param.gillog}
// gillog라는 parameter의 String Value를 return
// 발견되지 않으면 null
${paramValues.gillogs}
// gillogs라는 parameter로 포함된 String[] Value를 return
// 발견되지 않으면 null
pageContext
object를 가져온다.
page-scoped
attribute의 이름을 Value에 Mapping 하는 Map
을 가져온다.
request-scoped
attribute의 이름을 Value에 Mapping 하는 Map
을 가져온다.
session-scoped
attribute의 이름을 Value에 Mapping 하는 Map
을 가져온다.
application-scoped
attribute의 이름을 Value에 Mapping 하는 Map
을 가져온다.
매개 변수 이름을 단일 String 매개 변수 값에 Mapping하는 Map
을 나타낸다.
ServletRequest.getParameter(String name)
을 호출하여 가져온다.
매개 변수 이름을 String 배열 매개 변수 값에 Mapping하는 Map
을 가져온다.
ServletRequest.getParameterValues(String name)
을 호출하여 가져온다.
헤더 이름을 단일 String 헤더 값에 Mapping하는 Map
을 가져온다.
ServletRequest.getHeader(String name)
을 호출하여 가져온다.
헤더 이름을 String 배열 헤더 값에 Mapping하는 Map
을 가져온다.
ServletRequest.getHeaders(String name)
을 호출하여 가져온다.
쿠키 이름을 단일 쿠키 개체에 Mapping하는 Map
을 가져온다.
HttpServletRequest.getCookies()
를 호출하여 가져온다.
동일한 이름을 여러 쿠키에서 공유하는 경우 구현은 getCookies() 메서드에 의해 반환된 쿠키 개체 배열에서 첫 번째 개체를 사용해야 한다.
반환되는 쿠키 순서는 현재 Servlet 규격에 맞게 지정되어 반환되지 않는다.
context 초기화 parameter name을 문자열 매개 변수 값에 Mapping하는 Map
을 가져온다.
ServletRequest.getInitParameter(String name)
를 호출하여 가져온다.
Returns a Map that maps context initialization parameter names to their string values.
It invokes ServletRequest.getInitParameter(String name).
These implicit objects provide convenient access to various aspects of the JSP environment, such as request parameters, session attributes, headers, and cookies. lol shot io