ins0320 / servlet1128

0 stars 0 forks source link

Servlet 수업 정리 #1

Open ins0320 opened 10 months ago

ins0320 commented 10 months ago

23.11.24

< WAS실행 흐름 >

ins0320 commented 10 months ago

23.11.27 < STATUS CODE>

200 OK -  수행이 성공적으로 끝남 // 최종목적지
302 - 다른 페이지로 보낸다.

4XX에러 - 서버에 도달하지도 못함
400 - bad request( request parameter 잘못)
404 - page not found (주소 잘못, 매핑 없음, 페이지 없음)
405 - 405 - method 불일치

5XX에러 - 서버에 도달, 서버의 오류
500에러 - 서버 코드 오류
504 internal server error -  트래픽 오류 (다량의 접속)
ins0320 commented 10 months ago

23.11.28

< Servlet, html 접근 주소> servlet경로: mapping 주소 html 접근 경로: webapp 밑에 파일 경로부터 / 붙여서 ex) http//localhost:80/lesson01/ex03.html

< 쿼리 스트링> http: //localhost/lesson01/ex03.html?user_id=marobiana 쿼리스트링: key-value 정보 쌍을 서버한테 넘겨줌 Request Parameter: 쿼리스트링의 key 이 key 값을 통해 value를 얻어와 응용 함

< Servlet, html 사이 쿼리스트링 통한 매개변수 전달 >

ins0320 commented 10 months ago

23.11.29

< json >

< Request Method: 서버에 데이터를 보내는 방법 > 1. GET

ins0320 commented 10 months ago

2. POST

< filter 흐름 > [request] 브라우저 -> filter -> servlet [response] 브라우저 <- filter <- servlet

< 디버깅 하는 법>

  1. breakpoint를 건다(더블클릭)
  2. 페이지 수행
  3. f6을 눌러서 한 줄씩 아래로 수행하며 값이 잘 들어오는지 (variables)통해 확인
  4. f8눌러서 모든 코드 넘겨버리기(수행시키기)
ins0320 commented 10 months ago

23.12.04 parameter로 값 가져오기

ins0320 commented 9 months ago

23.12.11 값을 입력받아, DB에 저장후, 화면으로 보여주기( insert, delete 기능 만들기 - DB와 연동)

[문제 출력 예시] / 이미지 출처: Copyright © marondal 2021 image image

[ 코드 흐름] servlet 흐름