본문 바로가기

Backend/Servlet

URL / URI / ContextPath / ServletPath

URL : 전체 주소

  • http://localhost:8080/Servlet01/second
  • 프로토콜 + IP + 포트 번호 + URI

URI : ContextPath + ServletPath

  • /Servlet01/second
  • 프로젝트명 + 서블릿 매핑 이름

ContextPath : 프로젝트명

  • /Servlet01

ServletPath : 서블릿 매핑 이름 (원래 : 패키지명 + 파일명) 임의로 변경해서 사용 가능

  • /second
  • 간결성
  • 보안 유지
프로토콜 IP 포트 번호 프로젝트명 패키지명 + 파일명
http localhost 8080 Servlet01 first
      ContextPath ServletPath
      URI
URL