일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- db
- http
- JPQL
- 인프런
- spring
- 스프링
- SpringBoot
- pointcut
- Spring Boot
- Servlet
- jpa
- QueryDSL
- 김영한
- kotlin
- java
- 백준
- 알고리즘
- springdatajpa
- 자바
- Proxy
- 스프링 핵심 원리
- Thymeleaf
- Android
- 그리디
- Exception
- transaction
- 스프링 핵심 기능
- JDBC
- AOP
- Greedy
- Today
- Total
목록HTML (9)
개발자되기 프로젝트
1. REST - Representational State Transfer: 자원의 상태 전달 Client, Server: 클라이언트와 서버가 서로 독립적으로 분리되어 있어야 한다. Stateless: 요청에 대해서 클라이언트의 상태를 서버에 저장하지 않는다. Cache: 클라이언트는 서버의 응답을 캐시할 수 있어야 한다. 클라이언트가 캐시를 통해서 응답을 재사용 할 수 있어야 하며, 이를 통해서 서버의 부하를 낮춘다. Layered System(계층화): 서버와 클라이언트 사이에 방화벽, 게이트웨이, Proxy 등 다계층 형태를 구성할 수 있어야 하며, 확장할 수 있어야 한다. 인터페이스의 일관성: 아키텍처를 단순화 시키고 작은 단위로 분리하여서, 클라이언트 , 서버가 독립적으로 개선될 수 있어야 한다..
1. 댓글 삭제버튼 추가 간단하게 table 안에 을 추가해줬다. 이 때 PathVariable로는 comment의 id, QueryParameter로 현재 Post의 id를 넘겨준다. 작성자 내용 작성일 삭제 작성자 댓글 내용 2. Controller view에서 넘어오는 PathVariable, QueryParameter를 받아서 처리함. comment 삭제 후 현재 게시물로 redirect @PostMapping("/{commentId}/delete") public String deleteComment(@PathVariable("commentId") Long id, @RequestParam("postId") Long postId, RedirectAttributes redirectAttributes)..
Thymeleaf에 Converter를 적용해보자. 1. Controller @Controller public class ConverterController { @GetMapping("/converter-view") public String converterView(Model model){ model.addAttribute("number", 10000); model.addAttribute("ipPort", new IpPort("127.0.0.1", 8080)); return "converter-view"; } } 2. converter-view.html ${number}: ${{number}}: ${ipPort}: ${{ipPort}}: 기존과는 다르게 ${{...}}가 있다. ${number}: ${{..
API예외 처리는 SpringBoot의 기본 오류 처리 방식을 사용할 수 있음. 1. BasicErrorController SpringBoot가 제공하는 기본 ErrorController @Controller @RequestMapping("${server.error.path:${error.path:/error}}") public class BasicErrorController extends AbstractErrorController { @RequestMapping(produces = MediaType.TEXT_HTML_VALUE) public ModelAndView errorHtml(HttpServletRequest request, HttpServletResponse response) {} @Reques..
1. 셀렉트 박스 여러 선택지 중 하나를 선택하는 경우. 2. select 박스 추가 배송 방식 빠른 배송 일반 배송 느린 배송 셀렉트 박스로 하나만 선택이 가능. 3. Controller 자바 객체 사용. @ModelAttribute("deliveryCodes") public List deliveryCodes(){ List deliveryCodes = new ArrayList(); deliveryCodes.add(new DeliveryCode("FAST", "빠른 배송")); deliveryCodes.add(new DeliveryCode("NORMAL", "일반 배송")); deliveryCodes.add(new DeliveryCode("SLOW", "느린 배송")); return deliveryCod..
1. 라디오 버튼 라디오 버튼은 여러 선택지 중에 하나를 선택할 때 사용할 수 있음 2. 라디오 버튼 추가 상품 종류 도서, 식품, 기타 ENUM 사용 3. Controller @ModelAttribute("itemTypes") 사용 return되는 ItemType.values()를 model의 attribute에 추가함. ItemType.values() -> ENUM의 모든 정보를 배열로 반환. @ModelAttribute("itemTypes") public ItemType[] itemTypes(){ return ItemType.values(); } 4. addForm.html type.name() : enum의 name?? Returns the name of this enum constant, exa..
1. HTTP 응답 메시지는 주로 아래 내용을 담아서 전달됨. 단순 텍스트 응답 writer.println("ok"); HTML 응답 HTTP API - MessageBody JSON 응답 2. HttpServletResponse - HTML 응답 content-type : text/html @WebServlet(name = "ResponseHtmlServlet", urlPatterns = "/response-html") public class ResponseHtmlServlet extends HttpServlet { @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws Servlet..
영화 리뷰 관리를 위해 필요한 필수 기능인 comment 기능을 추가해보자. 이미 필요 기능은 구현되어 있고, 프론트를 통해 실행시킬 수 있어야 한다. 1. 자바스크립트 기존에 작성되어있는, Vue객체인 movie_list 내부에 addComment function을 추가했다. 해당 fucntion은 commentBox의 content를 가져와서 Post method를 실행한다. 이후 성공시 전체 movie리스트를 불러와서 프론트를 업데이트한다. var movie_list = new Vue({ el: '#movie-list', data: { movie_list : {} }, methods: { deleteMovie: function (id) { $.ajax({ type: "DELETE" , async: ..