7. 근거 2. 서블릿은 리턴해야할 값
을 request에 저장해 둔다고 하
던데 . . .• BeerSelect.java 중. . . (HttpServlet 상속받은 클래스
임)
String c = request.getParameter("color");
BeerExpert be = new BeerExpert();
List result = be.getBrands(c);
request.setAttribute("styles", result);
RequestDispatcher view =
request.getRequestDispatcher("result.jsp");
view.forward(request, response);
8. http://code.tutsplus.com/tutorials/from-beginner-to-advanced-in-opencart-understanding-mvc--cms-2162
1. Controllers
Controllers hold the main
control of the program. A
controller is responsible for
the program flow. In web-
based MVC applications, it
is also the first layer which
is called when the browser
hits the URL.
2. Models
Models hold the main data of the
program such as information from
database objects and SQL queries.
All data is gained from the models;
however, the models cannot be
directly called - it is a controller who
requests a model for specific data and
the model performs the request and
returns the data to that controller.
3. Views
A view is the last layer of the
MVC Architecture which
holds the user interface of
the program. In web
applications, a view contains
HTML, CSS, JavaScript,
XML or JSON, etc. The view
is a visible layer to the user
whereas the models and
controllers are hidden from
the user.
9. Let's understand that with the help of
conversation form when a user hits the
URL:
• Controller: Hey ABC Model: The user wants the XYZ
Data, please pass it to me.
• Model: Got the XYZ Data! Here it is.
• Controller: Hey ABC View, I am passing the XYZ
Data to you.
• View: Renders the information on the page for the
user to see.
10. 애플리케이션 아키텍처
아키텍처란?
컴퓨터에 필요한 논리적 기능이나 표현 방식 또는 컴퓨터의 기능요소와
그 구성방식 등 하드웨어를 제작하는 데 해당되는 설계시방(示方). 컴퓨터
아키텍처라고도 한다.
수요자 입장에서 본 컴퓨터의 하드웨어 구조나 동작 및 논리 구조의 개념
이다.
아키텍처는 컴퓨터의 연산장치, 내부 기억장치, 각종 레지스터, 제어장치
등 중요 구성요소와 외부 기억장치, 입출력 장치, 내 · 외부 버스 구조와 이
들의 제어장치 등을 어떻게 결합하고 배치하여 전체적으로 어떤 용량과
성능을 갖도록 구성하는가를 취급한다.
아키택처의 방식에 따라 컴퓨터의 용도 · 처리속도 등이 크게 달라진다.
아키텍처를 변경할 때는 호환성을 갖도록 한다.
http://www.scienceall.com/%EC%95%84%ED%82%A4%ED%85%8D%EC%B2%98architectur
15. 결국 3장을 따라했다는
건?
클라이언트 주소입
력
컨테이너 (톰캣)
web.xml 확인
파일시스템에 요청
서블릿에 요청
BeerSelect (서블릿)
BeerExpert (모델)
request 객체result.jsp (뷰)
없다
있다
요청
있으면 리턴
(form.html) 없으면 없다고
알 림
설정된
에러페이지 리턴
리턴해야할 값을
request에 저장
JSP에 request객체
포워딩
request객체속
정보 추출
HTML페이지
가공해서 리턴