2010. 7. 5. 20:39 JAVA , JSP
include directive vs include action tag
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<!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=EUC-KR">
<title>Insert title here</title>
<style type="text/css">
a {
text-decoration: none;
font-weight: bold;
color:green;
}
a:hover {
text-decoration: underline;
font-weight: bold;
color:red;
}
</style>
</head>
<body>
<p>이것은 좋은 메뉴</p>
<ul>
<li><a href="page1.jsp">page 1</a></li>
<li><a href="page2.jsp">page 2</a></li>
<li><a href="page3.jsp">page 3</a></li>
<li><a href="page4.jsp">page 4</a></li>
</ul>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<!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=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<!-- 아래 두 가지 방법을 사용 -->
<table border="1">
<tr>
<td>
include directive
</td>
<td>
<!-- 변수가 공유 된다. -->
<%@ include file="menu.jsp" %>
</td>
</tr>
<tr>
<td>
include action tag
</td>
<td>
<!-- 변수가 공유 되지 않는다. -->
<jsp:include page="menu.jsp" flush="false"/>
</td>
</tr>
</table>
</body>
</html>
'JAVA , JSP' 카테고리의 다른 글
redirect servlet (0) | 2010.07.05 |
---|---|
redirect (0) | 2010.07.05 |
서블릿 파일 생성하고 실행 (0) | 2010.07.05 |
[게시판] web 개발환경 설정, DB 설정, web.xml (0) | 2010.07.03 |
우분투에서 서버에 접속하는 방법 및 vi editor 명령어 (0) | 2010.07.03 |