Web/JSP
JSP) xml, application 객체
surhommejk
2018. 3. 20. 15:12
web.xml
WebContent 안에 있는 모든 페이지가 공유할 수 있는 자원이면서 영향을 받는 설정이라고 볼 수 있다. 웹 어플리케이션 하나가 갖는 하나의 설정파일과도 같다. 웹 전체를 설정하고 여러가지 정보를 저장한다. 따라서 웹 어플리케이션 구동시 가장 먼저 web.xml을 읽게 된다. (클라이언트는 web.xml에 접근 할 수 없다. WEB-INF는 보안 폴더로 클라이언트가 접속할 수 없는 경로다)
welcom-file-list
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
>> context root로 접근하면 띄워줄 defalut 페이지를 설정한다. 복수의 파일이 설정된 경우 맨 위에 있는 것이 우선권을 갖는다.
Context-param
<context-param>
<description>기본적인 설명을 하시면...</description>
<param-name>email</param-name>
<param-value>webmaster@bit.or.kr</param-value>
</context-param>
<context-param>
<description>파일 저장 경로</description>
<param-name>FilePath</param-name>
<param-value>C:\\Web\\download</param-value>
</context-param>
>> web.xml에 초기 파라미터를 설정한다. 이 값은 웹 어플리케이션 어디에서든 application 객체를 통해 사용이 가능하다. ( ex: application.getInitParameter("param-name"); )
Application 객체 함수