본문 바로가기
jsp

jsp_내장객체 (application)

by 신방동불주먹 2022. 11. 23.

<application>

 

  • web.xml : 톰캣서버 구동시 필요한 정보를 초기화 하는 역할 
  • String str="자바 입니다. " 와 같다
  • 설정 후 서버 리스타트 필요
 <context-param>
  	<param-name>INIT_PARAM</param-name>
  	<param-value>web.xml에 저장한 초기화 매개변수</param-value>
  </context-param>

 

 

<getInitParameter>

 

  • 스크립틀릿 또는 표현식으로 사용
  • web.xml 을 통해 초기화된 매개변수의 파라미터값?
  • web.xml에 저장한 초기화 매개변수 이 값이 반환된다
<body>
	<h2>web.xml에 설정한 내용 읽어오기</h2>
	초기화 매개변수 : <%=application.getInitParameter("INIT_PARAM) %>
</body>

 

 

 

 

<getRealPath>

 

  •  서버의 물리적 경로를 읽어온다
  •  톰캣서버가 파일을 관리하는 실제 경로 
  • request의 getRealPath 와 같은 결과

 

<body>
	<h2>서버의 물리적 경로 얻어오기</h2>
	application 내장객체 : <%=application.getRealPath("/") %>
</body>

 

 

<out>

 

브라우저 화면에 값을 출력하기 위함

    <%
    out.print("<h1>out 내장 객체</h1>");
    %>

 

'jsp' 카테고리의 다른 글

자바빈 클래스  (0) 2022.11.23
jsp_영역객체  (0) 2022.11.23
jsp_내장객체(response)  (0) 2022.11.23
jsp_기본  (0) 2022.11.22
jsp_내장객체(request) get,post  (0) 2022.11.22