'Servletconfig와 ServletContext 정리'에 해당되는 글 1건

  1. 2012.04.24 2012-4-24 Servletconfig와 ServletContext 정리

* ServletConfig - 서블릿당 하나만 생긴다(초기파라미터 설정(특정 서블릿 조회)(문자열이 변경되었을 때 소스코드 변경없이 프로그램을 변경할 수 있게 하는 것)
- 구문 :
<init-param>
<param-name>
<param-value>
Init()를 이용해서 관리

초기파라미터 불러오는 메소드 : getInitParameter();//값이 없으면 null을 리턴

* ServletContext(application과 관계) - application에 있는 모든 서블릿에 접근 가능.(초기 파라미터를 xml에 설정해 두고 불러올 수 있음) 

초기파라미터 불러오는 메소드 : getInitParameter();//값이 없으면 null을 리턴

WebContainer가 ServletConfig와 ServletContext를 관리 

Posted by 조은성
,