본문 바로가기

MVC24

[스프링 MVC 1편] 2 - (3) HttpServletRequest * 스프링 입문은 Window로 스프링 MVC 1편은 Mac으로 진행합니다 * 진도 : 섹션2 - (3) ~ (4) * : 자바 클래스명, : 코드, : 단축키 1. HttpServletRequest HTTP 요청 메세지를 손쉽게 작성해주는 기능 구조 - HTTP 메소드 - URL - 쿼리 스트링 - 스키마, 프로토콜 - 헤더 조회 - form 파라미터 형식 조회 - message body 데이터 직접 조회 2. HttpServletRequest 사용 [ src - main - java - hello.servlet - basic - RequestHeaderServlet ] -@WebServlet(name = "requestHeaderServlet ", urlPatterns = ".. 2023. 10. 23.
[스프링 MVC 1편] 2 - (1) 프로젝트 생성 * 스프링 입문은 Window로 스프링 MVC 1편은 Mac으로 진행합니다 1. Open JDK11 설치 Archived OpenJDK GA Releases Archived OpenJDK General-Availability Releases This page is an archive of previously released builds of the JDK licensed under the GNU General Public License, version 2, with Classpath Exception. WARNING: These older versions of the JDK are provided to he jdk.java.net 아래 블로그를 참고해주세요 http.. 2023. 10. 18.
[스프링 MVC 1편] 1 - (3) 멀티스레드 1. Web Service Architecture 훑어보기 Web Server : HTTP 요청 Web Container에게 위임 * web.xml -> 어떤 URL과 Mapping되어 있는지 확인 * Client(browser)의 요청 URL을 보고 해당 Servlet을 실행(Thread 생성) (web.xml에는 어떤 내용들이 구성되어 있는가?) Web Container : service() 메소드 호출 전 Servlet 객체 메모리 적재 * Web Container는 적당한 Servlet 찾고 컴파일(.class 파일) * 컴파일(.class)된 파일을 메모리에 적재 (Servlet 객체 생성) * 메모리 적재 시, init() 메소드 실행 Web Container : 요청이 올 때마다 Thread.. 2023. 10. 18.
[스프링 입문] 2 - (1) 정적 컨텐츠, (2) MVC와 템플릿 엔진 [정적 컨텐츠] - 파일을 웹브라우저에 그대로 전달한다 src - main - resources - static 우클릭 → New - File 클릭 → hello-static.html 입력 → 강의 자료 코드 넣기 → run → 인터넷에 localhost:8080/hello-static.html 입력 ※ 과정 localhost:8080/hello-static.html 실행 ↓ 내장 톰켓 서버 입력 받음 ↓ Controller에서 hello-static 있는지 찾는다 ↓ 없으면 내부 resources에서 hello-static 찾는다 ↓ 찾았으면 웹 화면에 출력 [MVC와 템플릿 엔진] - 서버에서 프로그래밍해서 html을 동적으로 바꿔 출력 ( View = 화면그리기 , Controller = 비지니스 .. 2023. 7. 29.