티스토리 뷰
JSP directives는 container안의 내용에 명령을 전달하는 역할을 해서 각 container들이 JSP processing을 할때 어떻게 데이터를 handle 해야하는지를 말해준다.
<%@ directive attribute = "value" %>
3 가지의 directive tag가 존재한다:
- JSP page directive: Defines page-dependent attributes(예: scripting 언어 설정, error page, buffering requirements 등...)
- <%@ page ... %>
- JSP include directive: Includes a file during the transition phase, 웹 페이지에서 다음 페이지로 넘어가도 공통되게 사용되는 부분들을 고정할 때도 쓰인다
- <%@ include ...%>
- JSP taglib directive : Declares a tag library, containing custom actions used in the page
- <%@ taglib ... %>
JSP Page Directive
현재 페이지에 속해 있는 container 명령어이다. 보통 페에지 맨 위애 정의된다.
- import : 특정 class를 사용하고 싶을 때 사용한다, 여기서 "value"부분은 우리가 불러오기 하고 싶은 패키지의 이름이다
- contentType: MIME(Multipurpose Internet Maril Extension)
- buffer : buffer 크기를 변경할 때 사용된다 (기본 크기는 8kb이다)
- autoFlush
- contentType
- errorPage: 에러가 날때 이동할 페이지를 지정한다.
- isErrorPage: Error page의 여부를 판달할 때 사용된다
- extends : defines the parent class that will be inherited by the generated servlet(잘 사용되지 않는다)
- import
- info : sets the info. of the JSP page which is retrieved later using getServletInfo()
- isThreadSafe
- language
- session
- isELIgnored: EL(Expression Language) 표현을 ignore하게 하는 것
사용) isELIgnored= "true" - isScriptingEnabled
JSP Include Directive
JSP는 (한번 interpret되고 나면)재사용이 가능하기 때문에 속도면에서 빠르다는 장점이 있다. PHP에서는 client로부터 요청이 올 때 마다 계속해서 해석을 해서 보내줘야하기 때문에 비효율적이다.
<html>
<body>
<%@ include file="header.html" %>
Today is: <%= java.util.Calendar.getInstance().getTime() %>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>This is a header file</h1>
<p>If you see this message, this means that the "include" directive
has successfully included "header.html"</p>
</body>
</html>
성공적으로 된다면:
JSP Taglib Directive
TLD(Tag Library Descriptor)를 이용해서 tag를 정의한다.
<%@ taglib uri="uriofthetaglibrary" prefix="prefixoftaglibrary" %>
'JSP' 카테고리의 다른 글
JSP: EL (0) | 2020.08.07 |
---|---|
JSP Action tags와 Javabean 사용법 (0) | 2020.08.06 |
Development in JSP (0) | 2020.08.06 |
JSP Project Hosting (0) | 2020.08.06 |
JSP 기초 (0) | 2020.08.03 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- meta #link #script #base #HTML
- JSP_CRUD
- 2020Camp
- DB4free
- jsp
- fontstyle
- javascript #datatype
- box_model
- HTML #class
- links lists tables display
- HTML_Forms
- Mavenproject
- annotation
- HTML #CSS
- HTML #id #iframe
- UserBean
- HTML_Formatting
- HTML #Tables
- HTML #Canvas #SVG
- HTML #Headings #Paragraph #Styles
- STS4
- HTML #media #video #YouTube
- 인용문 #주석
- text_shadow
- head #title #style
- DynamicWebProject
- Block_element #inline_element
- JSP환경구축
- css
- html
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함