본문 바로가기

Programming/[JSP]

[JSP] template

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
32
33
34
35
36
37
38
39
40
41
42
<%@ 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>Include</title>
</head>
<body>
<% 
    String paramPage = request.getParameter("page");
    if(paramPage==null) {
        paramPage = "newitem.jsp";
    }
%>
<center>
<table  border="1" cellpadding="0" cellspacing="0">
<tr>
  <td colspan="2">
      <jsp:include page="top.jsp" flush="false"/>
   </td>
</tr>
 
<tr>
  <td valign="top">
      <jsp:include page="left.jsp" flush="false"/>
   </td>
   <td  valign="center">
        <jsp:include page = "<%= paramPage %>" flush="false"/>
   </td>
</tr>
 
<tr>
  <td colspan="2">
    <jsp:include page="bottom.jsp" flush="false"/>
  </td>
</tr>
 
</table>
</center>
</body>
</html>
cs

template.jsp

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<%@ 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>
<br>
<a href="?page=newitem.jsp">신상품</a>
<br><br>
<a href="?page=bestitem.jsp">인기상품</a>
<br><br>
</body>
</html>
cs

left.jsp

 

다른 페이지는 중요하지 않으므로 스킵

'Programming > [JSP]' 카테고리의 다른 글

[JSP] 썸네일 만들기  (0) 2018.05.01
[JSP] 파일 업로드 기초  (0) 2018.05.01
[JSP][JAVA BEANS] 회원가입 유효성 검사  (2) 2018.04.16
[JSP] 쇼핑몰에서 장바구니에 담기  (0) 2018.04.13
[JSP] 스코프(Scope)란?  (0) 2018.04.12