메뉴 건너뛰기

2017.09.12 02:46

지시자(Directive)

조회 수 3123 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

지시자(Directive)

JSP 페이지의 전체적인 속성을 지정할 때 사용한다.

page, include, taglib

<%@ %>


page

해당 페이지의 전체적인 속성 지정

언어 지정import문을 많이 사용한다.

  1. <%@page import="java.util.Arrays"%>
  2. <%@ page language="java" contentType="text/html; charset=EUC-KR"
  3.    pageEncoding="EUC-KR"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
  6. <title>Insert title here</title>
  7. </head>
  8.     <%
  9.     int[] iArr = {102030};
  10.     out.println( Arrays.toString(iArr) );
  11.     %>
  12. </body>
  13. </html>


include

현재 페이지내에 다른 페이지를 삽입할 때 사용한다.

file속성을 이용한다.


include.jsp

  1. <%@ page language="java" contentType="text/html; charset=EUC-KR"
  2.    pageEncoding="EUC-KR"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
  5. <title>Insert title here</title>
  6. </head>
  7.     <h1> include.jsp 페이지 입니다.</h1><br/>
  8.     <%@ include file="include2.jsp" %>
  9.     <h1> 다시 include.jsp 페이지 입니다.</h1>
  10. </body>
  11. </html>


include2.jsp

  1. <%@ page language="java" contentType="text/html; charset=EUC-KR"
  2.    pageEncoding="EUC-KR"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
  5. <title>Insert title here</title>
  6. </head>
  7.     <h1>include2.jsp 페이지 입니다.</h1>
  8. </body>
  9. </html>


taglib

사용자가 만든 tag들을 태그라이브러리(tag library)라고 한다.

태그라이브러리를 사용하기 위해 taglib지시자를 사용한다.

속성 : uri, prefix

uri는 태그라이브러리의 위치 값을 갖는다.

prefix는 태그를 가리키는 이름 값을 갖는다.


  1. 주석(comments)

  2. 지시자(Directive)

  3. 스크립틀릿(Scriptlet), 선언(declaration), 표현식(expression)

  4. JSP 동작 원리, 내부 객체

  5. Oracle Database DB연결, table 생성

Board Pagination Prev 1 2 3 4 Next
/ 4

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved