본문 바로가기
☕Java/Java EE(Jakarta EE)

[20210629] JSTL의 태그 종류, MVC 모델

by 캔 2021. 6. 29.

JSTL의 태그 종류

- Core(c): remove, set, choose, forEach, forTokens, if, import, redirect, url, catch, out

- Formatting(fmt): requestEncoding, setLocale, formatNumber, parseNumber, formatDate, timeZone, setTimeZone, bundle, setBundle, message

- SQL(sql): setDataSource, query, update, param, dateParam, transaction

-Functions(fn): length(), substring(), substringAfter(), substringBefore(), toUpperCase(), toLowerCase(), replace(), indexOf(), startsWith(), endsWith(), contains(), containsIgnoreCase(), trim(), join(), excapeXml()

MVC 모델

MVC 모델(Model-View-Controller model)은 웹 애플리케이션의 개발 패턴 중 하나이다

모델은 데이터의 검색, 삽입, 수정, 삭제 등 비즈니스 로직. 예) DAO, DTO, Bean

뷰는 클라이언트에게 보여줄 화면과 같은 표현(Presentation) 로직. 예) JSP 파일, HTML 파일

컨트롤러는 클라이언트의 요청을 처리하기 위해 모델과 뷰 역할 간의 흐름 제어를 담당하는 역할. 예) Servlet 또는 JSP

MVC 모델 1

M: DAO V: JSP C: Bean

컨트롤러와 뷰를 분리하기 어려운 단점이 있다.

MVC 모델 2

M: DAO V: JSP C: Servlet

MVC 모델 1의 단점을 수정한 모델이다. EL과 JSTL을 사용하여 뷰와 컨트롤러를 분리하는 것이 가능하게 만들었다.