Open ins0320 opened 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 - 트래픽 오류 (다량의 접속)
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 사이 쿼리스트링 통한 매개변수 전달 >
23.11.29
< json >
{"키1": 값, "키2": 값} //1개
[ {"키1": 값, "키2": 값}, {"키1": 값, "키2": 값} ] //여러개
< Request Method: 서버에 데이터를 보내는 방법 > 1. GET
2. POST
< filter 흐름 > [request] 브라우저 -> filter -> servlet [response] 브라우저 <- filter <- servlet
< 디버깅 하는 법>
23.12.04 parameter로 값 가져오기
23.12.11 값을 입력받아, DB에 저장후, 화면으로 보여주기( insert, delete 기능 만들기 - DB와 연동)
[문제 출력 예시] / 이미지 출처: Copyright © marondal 2021
[ 코드 흐름]
23.11.24
< WAS실행 흐름 >
브라우저에서 서버로 요청(request)이 들어옴 -> WAS(tomcat)에서 요청을 받아 HttpServletRequest, HttpServletResponse 객체 생성 -> url mapping(path정보보와 이리하는 코드를 찾아 매핑) -> path 정보와 일치하는 코드 실행(작성한 servlet코드)->response 생성됨 -> WAS를 통해 브라우저로 response 반환
servlet** 코드 수행 흐름
cf) < servlet-mappping > -> < url pattern >: domain 입력후 뒤에 "/hello" 입력하면이 hello인게 동작 됨
< url-pattern >: url 입력 값을 지정한다.( 지정한 값이 url에 포함되면, 동작할 수 있게) 반드시 "/" 포함하기