以movie新增为例, 使用thymeleaf 框架 ,预先定义好layout.html:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-store"/> <meta http-equiv="Expires" content="0" /> <title layout:title-pattern="$DECORATOR_TITLE - $CONTENT_TITLE">UI演示</title> <link th:href="@{/styles/global.css}" rel="stylesheet" type="text/css"/> <script th:src="@{/scripts/jquery.min.js}"></script> <script th:src="@{/scripts/artDialog/artDialog.js}" /> <script th:src="@{/scripts/common.js}"></script> <script th:src="@{/scripts/public/public.js}"></script> <script th:src="@{/scripts/public/json2.js}"></script> <script type="text/javascript" th:src="@{/scripts/validate/jquery.validate.min.js}"></script> <script type="text/javascript" th:src="@{/scripts/validate/chinese.js}"></script> </head> <body> <div class="headerBox"> <div class="topBox"> <div class="topLogo f-left"> <a href="#"><img th:src="@{/images/logo.png}"/></a> </div> <div class="new-nav"> <h3>