SlideShare a Scribd company logo
0x06. Java Servlet, Session
Yu YongWoo
(http://LuckyYoWu.tistory.com)
1
Java Servlet ?
자바 서블릿(Java Servlet)은 자바를 사용하여 웹페이지를 동적으로 생성하는 서버측 프로그램
서블릿 파일은 *.class 확장자를 가진다.
2
Apache Tomcat
톰캣은 웹 서버와 연동하여 실행할 수 있는 자바 환경을 제공하여 자바 서버 페이지(JSP)와 자바
서블릿이 실행할 수 있는 환경을 제공
http://localhost:8080
3
Model-View-Contoller Model 2
모델-뷰-컨트롤러(Model–View–Controller, MVC)는 소프트웨어 공학에서 사용되는 아키텍처
패턴이다.
흔히 MVC 모델 2라고 하면 된다.
4
MVC Model 2 Example
5
BBSinput.html
6
BBSPostServlet.java
7
WEB-INF
8
1. javac 명령으로 java 파일 컴파일
2. tomcat 디렉토리에 WEB-INF 디렉토리를 생성
3. WEB-INF 디렉토리 아래에 classes 디렉토리 생성
4. 컴파일된 servlet class를 classes로 이동
WEB-INF/web.xml
9
@WebServlet("url")
10
Servlet 3.0 부터는 web.xml 을 생성하지 않고
클래스 선언부에서 @WebServlet 어노테이션을 추가해
web.xml 을 안만들수도 있다.
근데 지금 서버에서는 안됨ㅋ 왜 안되는지는 모르겠음ㅋ
SessionTest.java
11
SessionView.jsp
12
Practice
13

More Related Content

What's hot (20)

PDF
[오픈소스컨설팅]Spring MVC
Ji-Woong Choi
 
PPTX
[웹기반시스템 3조] mvc
구 봉
 
PPTX
SpringMVC 전체 흐름 알아보기
Myung Woon Oh
 
PPTX
세미나 Spring mybatis
Somang Jeong
 
PPTX
Presentation1
Tae Gyun Woo
 
PDF
아키텍트가 바라보는 Spring framework
Haeil Yi
 
PDF
막하는스터디 두번째만남 Express(20151025)
연웅 조
 
PDF
[제14회 JCO 컨퍼런스] 개발자를 위한 서버이중화 by JAVACAFE
흥래 김
 
PDF
JSP 프로그래밍 #01 웹 프로그래밍
Myungjin Lee
 
PPTX
Flux 예제 분석 2
Peter YoungSik Yun
 
PDF
nodejs websocket & SOCKET.IO
Mungyu Choi
 
PPTX
HOONS닷넷 오픈소스 프로젝트 Part1.
Hojin Jun
 
PDF
막하는 스터디 첫 번째 만남 Node.js
연웅 조
 
PPTX
What is the meteor?
Peter YoungSik Yun
 
PPTX
Apache http component
흥래 김
 
KEY
Meteor 0.3.6 Preview
Juntai Park
 
PDF
Node.js intro
Chul Ju Hong
 
PDF
Express 프레임워크
Choonghyun Yang
 
PDF
WebSocket 기반 쌍방향 메시징
trustinlee
 
PDF
JSP 프로그래밍 #02 서블릿과 JSP 시작하기
Myungjin Lee
 
[오픈소스컨설팅]Spring MVC
Ji-Woong Choi
 
[웹기반시스템 3조] mvc
구 봉
 
SpringMVC 전체 흐름 알아보기
Myung Woon Oh
 
세미나 Spring mybatis
Somang Jeong
 
Presentation1
Tae Gyun Woo
 
아키텍트가 바라보는 Spring framework
Haeil Yi
 
막하는스터디 두번째만남 Express(20151025)
연웅 조
 
[제14회 JCO 컨퍼런스] 개발자를 위한 서버이중화 by JAVACAFE
흥래 김
 
JSP 프로그래밍 #01 웹 프로그래밍
Myungjin Lee
 
Flux 예제 분석 2
Peter YoungSik Yun
 
nodejs websocket & SOCKET.IO
Mungyu Choi
 
HOONS닷넷 오픈소스 프로젝트 Part1.
Hojin Jun
 
막하는 스터디 첫 번째 만남 Node.js
연웅 조
 
What is the meteor?
Peter YoungSik Yun
 
Apache http component
흥래 김
 
Meteor 0.3.6 Preview
Juntai Park
 
Node.js intro
Chul Ju Hong
 
Express 프레임워크
Choonghyun Yang
 
WebSocket 기반 쌍방향 메시징
trustinlee
 
JSP 프로그래밍 #02 서블릿과 JSP 시작하기
Myungjin Lee
 

Viewers also liked (18)

PPTX
HeadFisrt Servlet&JSP Chapter 1
J B
 
PDF
웹 개발 스터디 01 - HTML, CSS
Yu Yongwoo
 
PDF
JSP 빠르게 시작하기
Park JoongSoo
 
PDF
Hellotutorial
hellotutorial
 
PDF
Playnode 2016 조승연
Kivol
 
PPTX
1주차 자기개발 항목(jsp 컴파일)
brain816
 
PDF
크리테오 설명서
TNM Media
 
PDF
로그인은 어떻게 동작하나?
Heemin Kim
 
DOCX
UpResume
Baji Shaik
 
PPT
Internet expandeix la societat
Raquel Casanovas de la Cruz
 
PPTX
Evaluation question 2
Sofia Green
 
PPTX
Presentacion power point. titas. andres e corrales v
andrescorralescb
 
PDF
SSH Bruteforce 공격 실제 사례 분석
Yu Yongwoo
 
PPT
Irish Sports Institute 2014 DaithiOMurchu
Dr. Daithí Ó Murchú
 
PDF
Legal translations
deep0000
 
PPTX
Politícas de integración tic en la normal superior
andrescorralescb
 
PPTX
VISUAL CV
rithika07
 
PDF
History of Coldplay
Sofia Green
 
HeadFisrt Servlet&JSP Chapter 1
J B
 
웹 개발 스터디 01 - HTML, CSS
Yu Yongwoo
 
JSP 빠르게 시작하기
Park JoongSoo
 
Hellotutorial
hellotutorial
 
Playnode 2016 조승연
Kivol
 
1주차 자기개발 항목(jsp 컴파일)
brain816
 
크리테오 설명서
TNM Media
 
로그인은 어떻게 동작하나?
Heemin Kim
 
UpResume
Baji Shaik
 
Internet expandeix la societat
Raquel Casanovas de la Cruz
 
Evaluation question 2
Sofia Green
 
Presentacion power point. titas. andres e corrales v
andrescorralescb
 
SSH Bruteforce 공격 실제 사례 분석
Yu Yongwoo
 
Irish Sports Institute 2014 DaithiOMurchu
Dr. Daithí Ó Murchú
 
Legal translations
deep0000
 
Politícas de integración tic en la normal superior
andrescorralescb
 
VISUAL CV
rithika07
 
History of Coldplay
Sofia Green
 
Ad

More from Yu Yongwoo (19)

PDF
2018 종합선물세트 for 취준생
Yu Yongwoo
 
PDF
나도 내가 뭘 말해야되는지 잘 모르겠어 (본격 스타트업 환상 부수기)
Yu Yongwoo
 
PDF
개발자가 되기전 누군가 알려주면 좋았을 모든 것들
Yu Yongwoo
 
PDF
웹 개발 스터디 01 - PHP 파일 업로드, 다운로드
Yu Yongwoo
 
PDF
웹 개발 스터디 01 - PHP, MySQL 연동
Yu Yongwoo
 
PDF
웹 개발 스터디 01 - MySQL
Yu Yongwoo
 
PDF
웹 개발 스터디 01 - PHP
Yu Yongwoo
 
PDF
웹 개발 스터디 02 - javascript, bootstrap
Yu Yongwoo
 
PDF
C 언어 스터디 05 - 파일 입출력
Yu Yongwoo
 
PDF
C 언어 스터디 04 - 구조체, 동적할당
Yu Yongwoo
 
PDF
C 언어 스터디 03 - 배열, 포인터
Yu Yongwoo
 
PDF
C 언어 스터디 02 - 제어문, 반복문, 함수
Yu Yongwoo
 
PDF
C 언어 스터디 01 - 기초
Yu Yongwoo
 
PDF
Bootstrap 기초, JSP Include
Yu Yongwoo
 
PDF
세션 하이재킹
Yu Yongwoo
 
PDF
리눅스 소켓 프로그래밍 기초
Yu Yongwoo
 
PDF
소프트웨어 공학 (최종 설계 명세서)
Yu Yongwoo
 
PPTX
'Database Design' Term Project initial Proposal Presentation (Korean)
Yu Yongwoo
 
PDF
2015_YoWu_SSM_Apply_PT
Yu Yongwoo
 
2018 종합선물세트 for 취준생
Yu Yongwoo
 
나도 내가 뭘 말해야되는지 잘 모르겠어 (본격 스타트업 환상 부수기)
Yu Yongwoo
 
개발자가 되기전 누군가 알려주면 좋았을 모든 것들
Yu Yongwoo
 
웹 개발 스터디 01 - PHP 파일 업로드, 다운로드
Yu Yongwoo
 
웹 개발 스터디 01 - PHP, MySQL 연동
Yu Yongwoo
 
웹 개발 스터디 01 - MySQL
Yu Yongwoo
 
웹 개발 스터디 01 - PHP
Yu Yongwoo
 
웹 개발 스터디 02 - javascript, bootstrap
Yu Yongwoo
 
C 언어 스터디 05 - 파일 입출력
Yu Yongwoo
 
C 언어 스터디 04 - 구조체, 동적할당
Yu Yongwoo
 
C 언어 스터디 03 - 배열, 포인터
Yu Yongwoo
 
C 언어 스터디 02 - 제어문, 반복문, 함수
Yu Yongwoo
 
C 언어 스터디 01 - 기초
Yu Yongwoo
 
Bootstrap 기초, JSP Include
Yu Yongwoo
 
세션 하이재킹
Yu Yongwoo
 
리눅스 소켓 프로그래밍 기초
Yu Yongwoo
 
소프트웨어 공학 (최종 설계 명세서)
Yu Yongwoo
 
'Database Design' Term Project initial Proposal Presentation (Korean)
Yu Yongwoo
 
2015_YoWu_SSM_Apply_PT
Yu Yongwoo
 
Ad

자바 서블릿과 세션 (Java Servlet, Session)