현재
[JSP] include, header, footer 본문
기본적으로 header.jsp 와 footer.jsp 는 webapp/commons 에 위치한다.
그리고 생성후 반드시 내용만 html과 관련된 태그들은 제거하고 필요내용만 작성한다!!
webapp/commons/footer.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<br>
풋터 내용들 회사 소개 등...
webapp/commons/header.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<br>
헤더 내용들이 마구 복잡하게 row col로 잡혀있는 내용...
webapp/WEB-INF/test1.jsp
<footer> footer가 존재하는 위치에 <jsp:include page="" /> 로 위치를 지정해준다.
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<!-- include -->
Test1과 관련된 내용들... + 풋터
<jsp:include page="./commons/footer.jsp" />
<br>
<a href="./test2.jsp">test2로 이동!</a>
</body>
</html>
webapp/WEB-INF/test2.jsp
<header> header가 존재하는 위치에 <jsp:include page="" /> 로 위치를 지정해준다.
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<jsp:include page="./commons/header.jsp" />
Test2와 관련된 내용들... + 헤더
<br>
<a href="./test1.jsp">test1로 이동!</a>
</body>
</html>'웹 프로그래밍 > JSP' 카테고리의 다른 글
| [JSP] Cookie (0) | 2023.10.18 |
|---|---|
| [JSP] tomcat 저장공간 Application, Session, Request, Page (2) | 2023.10.18 |
| [JSP] forward, redirect (0) | 2023.10.18 |
| [JSP] get, post, QueryString, form 및 데이터 전송 (1) | 2023.10.18 |
| [JSP] 지시자 및 기본 주석처리 (0) | 2023.10.18 |