본문 바로가기
프론트엔드(FrontEnd)

[JSP] jsp 태그 알아보기

by codeyaki 2023. 8. 4.
반응형

JSP 세팅

  • spring 3.0부터는 의존성 변경해야함
  • implementation 'jakarta.servlet:jakarta.servlet-api' implementation 'jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api' implementation 'org.apache.tomcat.embed:tomcat-embed-jasper' implementation 'org.glassfish.web:jakarta.servlet.jsp.jstl'

JSP 태그 문법 (xml 문법)

  • 주석
    • <%-- ... --%> (<!-- ... -->)
  • 선언
    • <%! ... %> (<jsp:declaration> ... </jsp:decleration>)
  • 지시
    • <%@ include ... %> (<jsp:directive.include .. />)
    • <%@ page ... %> (<jsp:directive.page .. />)
    • <%@ taglib ... %> (xmlns:prefix="tag library URL")
  • 표현
    • <%= ... %> (<jsp:expression> ... </jsp:expression>)
  • 스크립트
    • <% ... %> (<jsp:scriptlet> ... </jsp:scriptlet>)
반응형