티스토리 뷰
영역 나누기(header,footer)
<jsp:include page=""></jsp:include> |
jsp파일을 불러올 수 있다.
<예제>
header.jsp
1 2 3 4 5 6 7 8 9 10 11 12 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <h3>여기는 Header입니다.</h3> </body> </html> | cs |
footer.jsp
1 2 3 4 5 6 7 8 9 10 11 12 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <h3>이 부분은 Footer 입니다.</h3> </body> </html> | cs |
main.jsp
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"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <jsp:include page="header.jsp"></jsp:include> <a href="sub.jsp">sub로 이동하기!!</a> <jsp:include page="footer.jsp"></jsp:include> </body> </html> | cs |
sub.jsp
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"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <jsp:include page="header.jsp"></jsp:include> <a href="main.jsp">main로 이동하기!!</a> <jsp:include page="footer.jsp"></jsp:include> </body> </html> | cs |
[ 결과 화면 ]
반응형
'언어 > JSP' 카테고리의 다른 글
| [JSP] web.xml 에서 servlet 등록하기 (0) | 2016.10.31 |
|---|---|
| [JSP] EL / JSTL 정리 (0) | 2016.10.27 |
| [JSP] getRequestDispatcher 및 getAttribute (0) | 2016.10.27 |
| [JSP] request시 한글 깨질 경우 (0) | 2016.10.26 |
| [JSP] 톰캣 Server 한글 지원 (0) | 2016.10.26 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 음식
- Controller
- jdbc
- Server
- Create
- Default
- 사용
- mysql
- nsis
- 연결
- spring
- synchronized
- Class
- UTF-8
- 생성
- 클래스
- 종류
- Android
- jsp
- iNT
- java
- js
- 자바
- 어노테이션
- 스프링
- 라이브러리
- 안드로이드
- mybatis
- Delete
- 하기
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
글 보관함