일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- Servlet
- 스프링 핵심 원리
- db
- 그리디
- 인프런
- 스프링
- pointcut
- 자바
- springdatajpa
- Proxy
- spring
- http
- JPQL
- 백준
- 김영한
- kotlin
- Spring Boot
- 알고리즘
- Thymeleaf
- transaction
- Android
- jpa
- Greedy
- JDBC
- SpringBoot
- 스프링 핵심 기능
- Exception
- AOP
- java
- QueryDSL
- Today
- Total
목록인프런 (528)
개발자되기 프로젝트
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/9SKyO/btrep61mhwm/Ed1dZZwTrP5vv0KXLyMFk0/img.png)
1. HttpServletReponse의 역할 응답 메시지 생성 편의기능 제공 2. HTTP 응답 메시지 생성 HTTP 응답코드 지정 200, 400, 500, 401.. 헤더 생성 바디 생성 3. 편의기능 Content-Type, 쿠키, Redirect 4. 헤더 생성 @WebServlet(name = "ResponseHeaderServlet", urlPatterns = "/response-header") public class ResponseHeaderServlet extends HttpServlet { @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletExcept..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/SLlJ3/btreyfvpo7w/Mbb2ynCK6YOSHxPM50Dw6K/img.png)
1. HTTP 요청 데이터 - API 메시지 바디 - JSON HTTP API에서 주로 사용하는 JSON 형식으로 데이터를 전달해보자. 2. JSON형식 전송 POST http://localhost:8080/request-body-json content-type: application/json message body: {"username": "hello", "age": 20} 결과: messageBody = {"username": "hello", "age": 20} 3. JSON형식 파싱 추가 JSON형식으로 파싱할 객체를 생성 @Getter @Setter public class HelloData { private String username; private int age; } 4. JSON 받기. @W..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/polF6/btrewxXzNuC/K6wqIkAAmC8fx2FLqAkjmK/img.png)
1. message body에 직접 데이터 담기 HTTP API에서 주로 사용, JSON, XML, TEXT 데이터 형식은 주로 JSON 사용 POST, PUT, PATCH 2. HTTP 메시지 바디의 데이터 읽는 방법 InputStream을 사용 message body의 바이트 코드 얻음. StreamUtils.copyToString(Stream, 인코딩) 을 통해 STring으로 변환. @WebServlet(name = "RequestBodyStringServlet", urlPatterns = "/request-body-string") public class RequestBodyStringServlet extends HttpServlet { @Override protected void service(..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bYvfRH/btrevYulRLk/wKn4rXWhDL0iUMxTdfgO90/img.png)
1. HTTP 요청 데이터 - POST HTML Form HTML의 Form을 사용해서 클라이언트에서 서버로 데이터를 전송 2. 특징 content-type: application/x-www-form-urlencoded 메시지 바디에 쿼리 파리미터 형식으로 데이터를 전달한다. 3. HTML생성 username: age: 전송 http://localhost:8080/basic/hello-form.html 바로 접근 가능. 해당 form은 실행 시 post 방식으로 "/request-param"에 접근하여 하래 메서드 실행 데이터는 메세지 body에 쿼리 파라미터 형식으로 전달함. get 방식과 데이터 전달 방식이 같기 때문에 request.getParameter사용가능 ㅋㅋㅋ 즉 HttpServletReq..
1.GET , 쿼리파라미터 전달 데이터 username=hello age=20 URL : http://localhost:8080/request-param?username=hello&age=20 서버에서는 HttpServletRequest 가 제공하는 메서드를 통해 쿼리 파라미터를 조회할 수 있음.0 2. 전체 파라미터 조회 request.getParam(name)을 해야 parameter를 꺼낼 수 있음 /** * 1. 파라미터 전송 기능 * http://localhost:8080/request-param?username=hello&age=20 */ @WebServlet(name = "RequestParamServlet", urlPatterns = "/request-prarm") public class ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/v6xcY/btrevbuc230/faf6pVtShaJsbmZvqI6y71/img.png)
HTTP 요청 메시지를 통해 클라이언트에서 서버로 데이터를 어떻게 전달하지??? 1.GET - 쿼리 파라미터 /url?username=hello&age=20 메시지 바디 없이, URL의 쿼리 파라미터에 데이터를 포함해서 전달 예) 검색, 필터, 페이징등에서 많이 사용하는 방식 2. POST - HTML Form content-type: application/x-www-form-urlencoded -> 이 방식이 MESSAGE BODY에 쿼리 파라미터 형식으로 전달하는 방식임. 메시지 바디에 쿼리 파리미터 형식으로 전달 username=hello&age=20 예) 회원 가입, 상품 주문, HTML Form 사용 3. HTTP message body에 데이터를 직접 담아서 요청 HTTP API에서 주로 사용..
1. RequestHeaderServlet CLass @WebServlet(name = "requestHeaderServlet", urlPatterns = "/request-header") public class RequestHeaderServlet extends HttpServlet { @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { printStartLine(request); } private void printStartLine(HttpServletRequest request) { //start line정보 가져오기 S..
1. HttpServletRequest 서블릿은 개발자가HTTP 요청 메시지를 편리하게 사용할 수 있도록 알잘딱으로 HTTP 요청 메시지를 파싱한다. 그리고 그 결과를 HttpServletRequest 객체에 담아서 제공한다. 2. HTTP요청 메시지 예시 POST /save HTTP/1.1 Host: localhost:8080 Content-Type: application/x-www-form-urlencoded username=kim&age=20 START LINE HTTP 메소드 URL 쿼리 스트링 스키마, 프로토콜 헤더 헤더 조회 바디 form 파라미터 형식 조회 message body 데이터 직접 조회 3. 임시 저장소 기능 해당 HTTP 요청이 시작부터 끝날 때 까지 유지되는 임시 저장소 기능 ..