아파치/톰캣
아파치는 WebServer → 정적 페이지
톰캣은 WebApplicationServer → 동적 페이지를 응답할 수 있다. → 응답을 위해선 무조건 Java Language가 필요함.
소켓이 내장되어있음
설치하면
http://localhost:8080/ → C:\Program Files\Apache Software Foundation\Tomcat 11.0\webapps\ROOT 위치의 index파일이 열림

WEB-INF만 남기고 다삭제하고 새로운 html파일을 만들어서 코드 작성

확인

경로 C:\Program Files\Apache Software Foundation\Tomcat 11.0\conf
파일 web.xml을 vs코드로 켜면 맨 마지막에 있는 코드들의 역할은
개발자가 아무 요청을 하지 않으면 index.html, index.htm, index.jsp 파일을 자동으로 열어준다.


위 코드를 삭제하고 저장한다.
재시작


다시 확인

Servlet
스프링은 FrontController와 dispatcherSuvlet을 만들어줌
필터링을 통해 Web.xml에서 바로 Servlet을 보낼 수 있었지만, 요청 한번 당 하나의 Servlet을 만드는것은 메모리 용량을 많이 차지하기 때문에 역사속으로 사라졌다.
FrontController : 위의 역사속으로 사라진 과정 말고, 하나의 Servlet으로 해결하는 것.
모든 요청은 FrontController로 들어온다.
Servlet을 개발자가 직접 작성하기 때문에 각각의 회사(개발자)마다 Servlet을 작성하는 틀이 다르다. → 일의 일관성을 위해 스프링 프레임워크 생성

Share article