通常这就是我创建 JSP 文件的方式
<html>
<head>
<%@ include file="initDirectives.jsp"%>
<%@ include file="header-site.jsp"%>
<title><spring:message code="menu.about.us" /></title>
</head>
<body>
aboutttttttt.
</body>
</html>
我希望能够在我的页面上删除我的 JSP 文件的 2 包含,它们是:
initDirectives.jsp
其中包含类似的<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
代码header-site.jsp
其中包含我页面上菜单链接的标题
配置我的 Sitemesh 配置后,我创建default.jsp
如下
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="decorator"
uri="http://www.opensymphony.com/sitemesh/decorator"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="../views/initDirectives.jsp"%>
<%@ include file="../views/header-site.jsp"%>
<title><decorator:title default="DNA G2" /></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<decorator:head />
</head>
<body>
<div class="container clear-top">
<decorator:body />
<br>
<div id="footer">
<div class="container">
<p class="muted credit">© 2013 DNA G2. All Rights Reserved.</p>
</div>
</div>
</div>
</body>
</html>
最后,这是我的 JSP 页面包含的内容
<head>
<title><spring:message code="menu.about.us" /></title>
</head>
<body>aboutttttttt.
</body>
问题是spring:message
标签不再被识别。我在这里错过了什么?