carrot62 2020. 10. 16. 09:59

한눈에 보기

  • jsp action tag

<jsp:forward page=""/>

  • jsp directives

< %@ directive attribute="value"%>

-page directives
contentType, charset, import, buffer, autoFlush, isThreadSafe, session, errorPage, isErrorPage, isELIgnored, pageEncoding...

-include directives
file, 

-taglib directives

  • tag library

  • el(expression language

${변수명}
${requestScope.member.no} |   ${sessionScope.user} |    ${param.name}

 

 

 

JSP action tag

페이지들 사이에서 이동하거나 Java Bean을 사용하기 위해 쓰는 태그이다

  • jsp:forward: 다른 페이지나 리소스로 이동할 때 사용한다
<jsp:forward page="example.jsp" >  
  • jsp:param: 파라미터를 설정할 때 사용한다
a
  • jsp:include: 다른 페이지나 리소스를 포함하고 싶을 때 사용한다
a
  • jsp:useBean: 사용자가 정의해둔 "Bean"을 사용하고자 할 때 쓰는 태그
                    -Bean은 사용자가 정의한 패키지의 함수라고 생각하면 된다
aa

이외에도

  • jsp:getProperty
  • jsp:setProperty
  • jsp:plugin
  • jsp:fallback 등이 있다
  • 는 함수처럼 

JSP directives

  • page directive
  • include directive
  • taglib directive
<%@ directive attribute="value" %> 

 

 

tag library (JSTL)

라이브러리르 사용하고 싶다면 <taglib> directive을 맨 윗 부분에 추가 한 후 사용해야 한다

Core tags
<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>

- <c:out>, <c:set>, 

Formatting tags
<%@ taglib prefix = "fmt" uri = "http://java.sun.com/jsp/jstl/fmt" %>

-<fmt:formatNumber> , <fimt:formatate>

SQL Tags
<%@ taglib prefix = "sql" uri = "http://java.sun.com/jsp/jstl/sql" %>

-<sql:setDataSource>, <sql:query>

XML Tags
<%@ taglib prefix = "x" uri = "http://java.sun.com/jsp/jstl/xml" %>

-<x:out>, <x:parse>

JSTL Functions
<%@ taglib prefix = "fn" uri = "http://java.sun.com/jsp/jstl/functions" %>

fn:contains(), fn:indexOf(), fn:join(), ...

 

참고한 사이트:

jsp action tags: www.javatpoint.com/jsp-action-tags-forward-action

 

JSP Action Tags - javatpoint

JSP action tags with examples of session tracking, implicit objects, el, jstl, mvc, custom tags, file upload, file download, interview questions etc.

www.javatpoint.com

jsp directives: www.javatpoint.com/jsp-page-directive

 

JSP Directives | JSP Page Directive - javatpoint

JSP Directives and jsp page directive with examples of session tracking, implicit objects, el, jstl, mvc, custom tags, file upload, file download, interview questions etc.

www.javatpoint.com

jstl: www.javatpoint.com/jstl

 

JSTL Tutorial and Examples - javatpoint

JSTL Tutorial with examples on JSTL core tags, function tags, formatting tags, sql tags and miscellaneous tags. It includes c:out, c:import, c:set, c:if, c:when, c:choose, c:redirect, c:catch etc.

www.javatpoint.com