본문 바로가기

웹개발/JSP

web.xml 역할

웹 어플리케이션의 deployment descriptor(배포 설명자)로, 각 어플리케이션의 환경을 설정하는 역할을 한다. 서버가 처음 로딩될 때 읽어들이고, 해당 환경설정에 대해 tomcat에 적용하여 서버를 시작한다. 

 

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html;charset=utf-8");
	}

 => text/html 을 MIME type 이라고 한다. response 받는 브라우저에게 이 response 데이터가 '어떠한 종류의 데이터'인지를 알려주는 역할