My Programing/JSP and Servlet
12장 jsp의 include의 전부
nkdk
2008. 3. 9. 01:01
// top.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<h2>top 파일 부분</h2>
<%="안녕 TOP 부분이네요" %>
// bottom.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<h2>bottom 파일 부분</h2>
<% java.util.Date date= new java.util.Date(); %>
<%=date.toLocaleString() %>
// includetest.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<html>
<%@ include file="top.jsp" %>
<h1>include 연습</h1>
본문 처리
<%@ include file="bottom.jsp" %>
</html>
//intag.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
홀 수 출 력
<%
for(int i =1; i<=10;i++) {
if(i % 2 == 1) out.print(i + " ");
}
%>
<%=" * 액션 태그 : 각 페이지 간의 제어 이동 또는 애플릿 실행, 빈즈 사용 등" %>
<%=" 종류: include, forward, useBean, plugin .." %>
// intag2.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<% request.setCharacterEncoding("EUC-KR");
String ir = request.getParameter("irum");
%>
<%="넘겨진 값은 : " + ir %>
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<h2>top 파일 부분</h2>
<%="안녕 TOP 부분이네요" %>
// bottom.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<h2>bottom 파일 부분</h2>
<% java.util.Date date= new java.util.Date(); %>
<%=date.toLocaleString() %>
// includetest.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<html>
<%@ include file="top.jsp" %>
<h1>include 연습</h1>
본문 처리
<li>include file: 여러 페이지에 공통으로 사용되는 부분을
별도의 파일로 만들고 필요한 경우 호출 후 하나의 파일로 실행
--- 이 곳은 include action tag test ---
<font style='font-size:30px;color:blue'>
<jsp:include page="intag.jsp" />
<jsp:include page="intag2.jsp">
<jsp:param name="irum" value="KOREA" />
</jsp:include>
<%@ include file="bottom.jsp" %>
</html>
//intag.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
홀 수 출 력
<%
for(int i =1; i<=10;i++) {
if(i % 2 == 1) out.print(i + " ");
}
%>
<%=" * 액션 태그 : 각 페이지 간의 제어 이동 또는 애플릿 실행, 빈즈 사용 등" %>
<%=" 종류: include, forward, useBean, plugin .." %>
// intag2.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<% request.setCharacterEncoding("EUC-KR");
String ir = request.getParameter("irum");
%>
<%="넘겨진 값은 : " + ir %>