CH02 디렉티브(16강)

Gm·2021년 9월 21일
0

JSP 인프런강의

목록 보기
2/4

디렉티브 태그

  • jsp 페이지를 어떻게 처리할 것인지를 설정하는 태그
  • jsp 페이지가 서블릿 프로그램에서 서블릿 클래스로 변환활 때
    • jsp 페이지와 관련된 정보를 jsp 컨테이너에 지시하는 메시지

1. include 태그

실습01)

<Top.jsp>

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
	<center>
		<table width="600">
			<tr height="100">
				<td align="center" colspan="6">
					<font size="15">Camera 정보 사이트</font>			
				</td>
			</tr>
			<tr height="50">		
				<td align="center">케논</td>
				<td align="center">니콘</td>
				<td align="center">삼성</td>
				<td align="center">올림푸스</td>
				<td align="center">LG</td>
				<td align="center">SK</td>				
			</tr>
		</table>
	</center>	
</body>
</html>

<Bottom.jsp>

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
	<center>
		<table width="600">
			<tr height="100">
				<td align="center">
					회사소개 : 서울 특별시 강서구 달산구 대주 102동 <br>
					전화번호 : 02-3245-5465
				</td>
			</tr>			
		</table>
	</center>
</body>
</html>

<Include.jsp>

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
	<center>
		<table width="600" border="1">
			<!-- Top.jsp -->
			<tr height="150">
				<td width="600" align="center">
					<!--보통은 jsp 액션태그인 include를 사용한다.  -->
					<!-- include 디렉티브의 특징은 page로 병합 후 compile 한다 -->
					<%@include file="Top.jsp" %>
				</td>
			</tr>			
			<!--Center  -->
			<tr height="400">
				<td width="600" align="center">
					<img alt="" src="img/케논.jfif" width="400" height="300">
				</td>
			</tr>			
			<!-- bottom -->
			<tr height="100">
				<td width="600" align="center">
					<%@include file="Bottom.jsp" %>
				</td>
			</tr>
	</table>
</center>
```

0개의 댓글

Powered by GraphCDN, the GraphQL CDN