Sitemesh : layout des vues integré

pour faire une nouvelle page : creer jsp ds jsp / mettre balise include/html/head/body et le contenu dans body.
Sitemesh decorera la page automatiquement suivant le layout main.jsp dans decorators pour tte les url (du moins pour l'instant)
This commit is contained in:
Nicolas Michard
2008-01-20 15:37:53 +00:00
parent 74314c8d56
commit e8cccaf588
24 changed files with 290 additions and 431 deletions

View File

@@ -1,4 +1,3 @@
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<decorator:body />

View File

@@ -1 +1,11 @@
<h1>C'est le footer</h1>
<html>
<head></head>
<body>
<!-- Footer with credits -->
<div id="globalfooter">
Copyright Yacos Team 2008
</div>
</body>
</html>

View File

@@ -0,0 +1,30 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head></head>
<body>
<!-- containerheader -->
<div id="containerheader">
<div id="leftdescription">
<p>Application pour g<>rer les conf<6E>rences. Outil libre dans le programme universitaire</p>
</div>
<div id="rightchoice">
<c:choose>
<c:when test="${idCurrentConference!=null}">
La conf<6E>rence courante est : ${idCurrentConference}.<br />
<a href="<c:url value="listConference.htm"/>"><fmt:message key="conference.linkMenu.change" /></a>
</c:when>
<c:otherwise>
Il n'y a pas de conf<6E>rence courante.<br />
<a href="<c:url value="listConference.htm"/>"><fmt:message key="conference.linkMenu.choose" /></a>
</c:otherwise>
</c:choose>
</div>
</div><!--containerheader-->
</body>
</html>

View File

@@ -0,0 +1,15 @@
<html>
<head></head>
<body>
<!-- Globar bar navigation -->
<div id="globalheader">
<ul id="globalnav">
<li><a href="#">HOME</a></li>
<li><a href="#">INFOS</a></li>
<li><a href="#">POST</a></li>
</ul>
</div>
</body>
</html>

View File

@@ -0,0 +1,3 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

View File

@@ -1,20 +1,44 @@
<!-- Include -->
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>
<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@ taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!-- Doctype -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title><decorator:title default="YACOS" /></title>
<title><fmt:message key="title" /></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
<decorator:head />
</head>
<body>
BODY de la page d<>cor<6F>e :
<decorator:body />
/BODY de la page d<>cor<6F>e
<!-- headermenu -->
<div><page:applyDecorator name="empty" page="/WEB-INF/decorators/headermenu.jsp" /></div>
<!-- Main bloc -->
<div id="container">
<!-- main header with choice conference -->
<page:applyDecorator name="empty" page="/WEB-INF/decorators/headermainchoice.jsp" />
<div id="main">
<!-- dynamic menu with session -->
<page:applyDecorator name="empty" page="/WEB-INF/decorators/usermenu.jsp" />
<div id="maincontent">
<!-- Contents of decorated page -->
<decorator:body />
</div><!--maincontent-->
</div><!--main-->
</div><!--container-->
<!-- footer -->
<div><page:applyDecorator name="empty" page="/WEB-INF/decorators/footer.jsp" /></div>
</body>

View File

@@ -0,0 +1,30 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head></head>
<body>
<div id="mainmenu">
<div id="mainmenubloc">
<h4>Bloc 1</h4>
<ul>
<li><a href="<c:url value="listArticle.htm"/>"><fmt:message key="listarticle.title" /></a></li>
<li><a href="<c:url value="submissionArticle.htm"/>"><fmt:message key="submission.title" /></a></li>
<li><a href="<c:url value="choosePreference.htm"/>"><fmt:message key="preference.title" /></a></li>
<li><a href="<c:url value="dispatchArticle.htm"/>"><fmt:message key="dispatch.title" /></a></li>
<li><a href="<c:url value="addConference.htm"/>"><fmt:message key="conference.titleMenu" /></a></li>
</ul>
</div>
<div id="mainmenubloc">
<h4>Bloc 2</h4>
<ul>
<li><a href="#">Lien 1</a></li>
<li><a href="#">Lien 2</a></li>
<li><a href="#">Lien 3</a></li>
</ul>
</div>
</div><!--mainmenu-->
</body>
</html>

View File

@@ -1,25 +1,9 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page session="false"%>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title" /></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content"><jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<h2 align="center"><fmt:message key="conference.titleMenu" /></h2>
<form:form commandName="formConference" name="monForm">
@@ -28,15 +12,12 @@
<fmt:message key="conference.description" /> <textarea name="description"></textarea> <br/><br />
<fmt:message key="conference.otherInformations" /> <textarea name="otherInformations"></textarea> <br/><br />
<input type="submit" alignment="center" name="_target1" value="Next" />
<input type="submit" align="middle" name="_target1" value="Next" />
</form:form>
<br />
<a href="<c:url value="main.htm"/>">Home</a></div>
</div>
<div class="footer">&nbsp;</div>
</div>
<a href="<c:url value="main.htm"/>">Home</a>
</body>
</html>

View File

@@ -1,26 +1,12 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page session="false"%>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title" /></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
<link rel="stylesheet" href="./stylesheets/calendar.css" type="text/css" />
<script src="./stylesheets/calendar.js"></script>
</head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content"><jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<h2 align="center"><fmt:message key="conference.titleMenu" /></h2>
@@ -40,10 +26,7 @@
</form:form>
<br />
<a href="<c:url value="main.htm"/>">Home</a></div>
</div>
<div class="footer">&nbsp;</div>
</div>
<a href="<c:url value="main.htm"/>">Home</a>
</body>
</html>

View File

@@ -1,24 +1,9 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page session="false"%>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title" /></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content"><jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<h2 align="center"><fmt:message key="conference.titleMenu" /></h2>
@@ -42,14 +27,11 @@
<br />
<br />
<input type="submit" alignment="center" name="_target1" value="Back">
<input type="submit" alignment="center" name="_target3" value="Next" />
<input type="submit" align="middle" name="_target1" value="Back">
<input type="submit" align="middle" name="_target3" value="Next" />
</form:form> <br />
<a href="<c:url value="main.htm"/>">Home</a></div>
</div>
<div class="footer">&nbsp;</div>
</div>
<a href="<c:url value="main.htm"/>">Home</a>
</body>
</html>

View File

@@ -1,22 +1,9 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page session="false"%>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title" /></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content"><jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<h2 align="center"><fmt:message key="conference.titleMenu" /></h2>
@@ -30,15 +17,12 @@
<br /><br />
<input type="submit" alignment="center" name="_target2" value="Back">
<input type="submit" alignment="center" name="_target4" value="Next" />
<input type="submit" align="middle" name="_target2" value="Back">
<input type="submit" align="middle" name="_target4" value="Next" />
</form:form> <br />
<a href="<c:url value="main.htm"/>">Home</a></div>
</div>
<div class="footer">&nbsp;</div>
</div>
<a href="<c:url value="main.htm"/>">Home</a>
</body>
</html>

View File

@@ -1,22 +1,9 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page session="false"%>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title" /></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content"><jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<h2 align="center"><fmt:message key="conference.titleMenu" /></h2>
@@ -24,16 +11,13 @@
<br /> Page 5
<input type="submit" alignment="center" name="_finish" value="Next" />
<input type="submit" alignment="center" name="_target3" value="Back">
<input type="submit" align="middle" name="_finish" value="Next" />
<input type="submit" align="middle" name="_target3" value="Back">
</form:form>
<br />
<a href="<c:url value="main.htm"/>">Home</a></div>
</div>
<div class="footer">&nbsp;</div>
</div>
<a href="<c:url value="main.htm"/>">Home</a>
</body>
</html>

View File

@@ -1,24 +1,9 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<!--
<%@ page session="false" %> spring -> true par defaut
-->
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title"/></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content">
<jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<h2 align="center"><fmt:message key="preference.title" /></h2>
@@ -51,10 +36,5 @@
<a href="<c:url value="main.htm"/>">Home</a>
</div>
</div>
<div class="footer">&nbsp;</div>
</div>
</body>
</html>

View File

@@ -1,31 +1,15 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page session="false" %>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title"/></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content">
<jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<fmt:message key="preference.ok"/>
</div>
</div>
<div class="footer">&nbsp;</div>
</div>
</body>
</html>

View File

@@ -1,23 +1,9 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title"/></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content">
<jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<table>
<tr>
<th>articles to dispatch</th><th>members</th><th>members associate to the article</th>
@@ -62,11 +48,6 @@
</table>
</div>
</div>
<div class="footer">&nbsp;</div>
</div>
</body>
</html>

View File

@@ -1,20 +1,9 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head></head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><fmt:message key="title" /></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content"><jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<c:forEach items="${listArticle}" var="article">
<ul class="article">
<li class="title">${article.title}</li>
@@ -23,10 +12,7 @@
<li class="article_url"><a href="<c:url value="${article.URL_article}"/>">Download the article</a></li>
</ul>
</c:forEach>
</div>
</div>
<div class="footer">&nbsp;</div>
</div>
</body>
</html>

View File

@@ -1,24 +1,9 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title" /></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content"><jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<h2 align="center">Choose a conference</h2>
Choix de la conference <br /><br />
@@ -53,10 +38,7 @@
<br />
<a href="<c:url value="main"/>">Home</a></div>
</div>
<div class="footer">&nbsp;</div>
</div>
<a href="<c:url value="main"/>">Home</a>
</body>
</html>

View File

@@ -1,31 +1,13 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page session="false" %>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title"/></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
Page d'accueil <20> changer de place (controller dans system et non dans author)
Si conf active : page d'intro de la conf
si pas de conf active : page d'intro du site (visiteur)
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content">
<jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
Main Page
</div>
</div>
<div class="footer">&nbsp;</div>
</div>
</body>
</html>

View File

@@ -1,27 +1,9 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page session="false" %>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><fmt:message key="title"/></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content">
<jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<h2><fmt:message key="register.title" /></h2>
<form:form method="post" commandName="registerUser">
@@ -46,10 +28,5 @@
<a href="<c:url value="main.htm"/>">Home</a>
</div>
</div>
<div class="footer">&nbsp;</div>
</div>
</body>
</html>

View File

@@ -1,12 +1,7 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page session="false" %>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title"/></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
<script language="JavaScript">
function Ajouter(form) {
var o=new Option(form.secondaryauthor.value);
@@ -20,17 +15,7 @@ function Supprimer(form) {
</head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content">
<jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
<h2 align="center"><fmt:message key="submission.title" /></h2>
<form:form method="post" enctype="multipart/form-data" commandName="submissionArticle">
@@ -69,10 +54,5 @@ function Supprimer(form) {
<a href="<c:url value="main.htm"/>">Home</a>
</div>
</div>
<div class="footer">&nbsp;</div>
</div>
</body>
</html>

View File

@@ -1,35 +1,14 @@
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page session="false" %>
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<!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=ISO-8859-1">
<title><fmt:message key="title"/></title>
<link rel="stylesheet" href="./stylesheets/base.css" type="text/css" />
</head>
<head></head>
<body>
<jsp:include page="/WEB-INF/jsp/header.jsp" />
<div class="mainBloc">
<div class="header">&nbsp;</div>
<div class="content">
<jsp:include page="/WEB-INF/jsp/menu.jsp" />
<div id="main_content">
Soumission OK
<br />
<a href="<c:url value="main.htm"/>">Home</a>
</div>
</div>
<div class="footer">&nbsp;</div>
</div>
</body>
</html>