본문 바로가기

개발하자/JSP&Servlet

sitemesh 활용하기 (decorator)

 

 

 

WebContent/decorator/hello_decorator.jsp

============================================

<%@ page language="java" contentType="text/html; charset=EUC-KR"
 pageEncoding="EUC-KR"%>
<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<!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><decorator:title/></title>
<style type="text/css">
 .mainTable { width:500px; height:300px; }
 .mainTable td { background-color:#f0fff0; }
</style>
<decorator:head/>
</head>
<body>
 <table class="mainTable">
 <tr>
 <td colspan="2" style="height:50px;">
 <jsp:include page="top.jsp"/>
 </td>
 </tr>
 <tr>
 <td><jsp:include page="menu.jsp"/></td>
 <td><decorator:body/></td>
 </tr>
 </table>
</body>
</html>

 

WebContent/decorator/menu.jsp

============================================

<%@ page language="java" contentType="text/html; charset=EUC-KR"
 pageEncoding="EUC-KR"%>
<a href="loginform.jsp">로그인</a><br/>
로그아웃<br/>
회원목록<br/>
직원목록<br/>

 

WebContent/decorator/top.jsp

============================================

<%@ page language="java" contentType="text/html; charset=EUC-KR"
 pageEncoding="EUC-KR"%>
<h1 align="center">서울IT교육센터</h1>

 

WebContent/hello/a.jsp

============================================

<%@ 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>a.jsp페이지입니다.</title>
<style type="text/css">
 .a { color:green; }
</style>
</head>
<body>
 <h1 class="a">a.jsp페이지입니다.</h1>
</body>
</html>

 

WebContent/hello/loginform.jsp

============================================

<%@ 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>
<tr>
<td>ID</td><td><input type="text"></td>
</tr>
<tr>
<td>PW</td><td><input type="text"></td>
</tr>
<tr>
<td colspan="2"><input type="button"value="취소"><input type="submit"value="전송"></td>
</tr>
</table>
<tr>
</body>
</html>

 

'개발하자 > JSP&Servlet' 카테고리의 다른 글

주민번호 앞자리 검사 정규표현식  (0) 2015.03.26
정규표현식  (0) 2015.03.26
프로젝트 경로 pageContext.request.contextPath  (0) 2015.03.20
filter 필터  (0) 2015.03.19
Bundle사용하여 언어바꾸기  (0) 2015.03.19