본문으로 바로가기

메인 화면 소스코드 입니다.

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
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>Insert title here</title>
</head>
<body>
<center>
<form name=template>
<table border=1>
    <tr>
        <td colspan=2 width="400" height="50"><%@ include file="top.jsp" %></td>
    </tr>
    <tr>
        <td width="400" height="150" align=center><%@ include file="left.jsp" %></td>
        <td width="400" height="150" align=center>
        <%
            String paramPage = request.getParameter("page");
        
            if(paramPage==null) {
                paramPage = "newitem";
            }
            paramPage += ".jsp";
        %>
        <jsp:include page="<%= paramPage %>"></jsp:include></td>
    </tr>
    <tr>
        <td colspan=2 width="400" height="50" align=center><%@ include file="bottom.jsp" %></td>
    </tr>
</table>
</form>
</center>
</body>
</html
cs




left.jsp 파일의 소스코드 입니다.


1
2
3
4
5
6
7
8
9
10
11
12
13
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>Insert title here</title>
</head>
<body>
<a href="?page=newitem">신상품</a><br><br><br>
<a href="?page=bestitem">인기상품</a>
</body>
</html>
cs








아래는 실행 화면입니다.










인기상품을 클릭하면 내용이 바뀝니다. (get방식으로 파라미터값을 넘겨줬기 때문에 url의 변화가 일어납니다.)