JSP_Lecture 02

2023. 10. 16. 12:03Spring 활용 통합 시스템 개발/JSP

 

FirstServlet 클래스 파일 생성하기

FirstServlet에서 web.xml 파일 <web-app> 태그 아래에 <servlet> 내용, <servlet-mapping> 내용 입력하기

web.xml 에서 중요한 것은 <servlet>과 <servlet-mapping>에서 <servlet-name>을 똑같이 해야 url 매핑이 오류없이 진행된다

 

localhost:8090/Servlet/first  매핑결과

추상클래스 상속

SecondServlet 클래스파일 새로 생성하고 

web.xml 파일에 <servlet> 과 <servlet-mapping> 내용 입력하고 /second url로 SecondServlet 파일 메서드 호출할 때 콘솔에 찍히게 구현하기

실행결과

Servlet mapping with annotation

실행결과