Programming/[JSP]

[JSP] template

iD이드 2018. 4. 16. 19:40

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

 

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