Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 상속
- JavaScript
- Java
- Event
- springframework
- 윈도우 #단축키
- property
- 연산자
- 코틀린#클래스#상속
- jQuery
- spring
- 데이터베이스
- File 클래스
- 연락처 프로그램
- 자바
- GUI
- javaservlet
- 다형성
- function
- Method
- array
- String
- jsp
- 오라클
- 설치
- list
- 파일 입출력
- html
- kotlin #return #jump
- css
Archives
- Today
- Total
Binary World
JSP include Directive(지시자) 본문
<지시자를 이용한 파일 포함>
include 지시자(directive) 동작 원리:
- include를 사용해서 다른 파일(jsp, jspf)을 포함시키면, 하나의 JSP 파일로 합쳐진 이후에, 서블릿 클래스로 변환
<header.jspf>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <style> .header { background-color: lightgreen; font-size: 200%; text-align: center; height: 60px; } </style> <div class="header"> 여기는 Header입니다... </div> | cs |
<footer.jspf>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <style> .footer { background-color: lightblue; text-align: center; height: 60px; } </style> <div class="footer"> (주) 무한상사<br/> http://www.무한상사.co.kr<br/> TEL: 02-1132-3333 </div> | cs |
<04_include>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>JSP</title> </head> <body> <%-- header 파일을 include --%> <%@ include file="header.jspf" %> <h1>include Directive(지시자)</h1> <div><p>본문입니다....</p></div> <%-- footer 파일을 include --%> <%@ include file="footer.jspf" %> </body> </html> | cs |
<출력화면>
'개발자의 길 > JSP' 카테고리의 다른 글
JSP 에러 페이지 처리 (0) | 2017.04.12 |
---|---|
JSP 동작원리 및 구성 요소(TAG) (0) | 2017.04.12 |
<이클립스> JSP 파일 생성 시 포멧 변경하기 (0) | 2017.04.12 |
Comments