我对瓷砖 2.2.2 有疑问。似乎 jsp-s 没有按应有的方式读取。我的tiles.xml 看起来像这样:
<definition name="notLoggedInLayout" template="WEB-INF/pages/template/templatenotloggedin.jsp">
<put-attribute name="css" value="css/style.css" />
<put-attribute name="header" value="WEB-INF/pages/template/notloggedinheader.jsp" />
<put-attribute name="body" value="" />
<put-attribute name="footer" value="WEB-INF/pages/template/footer.jsp" />
</definition>
<definition name="login" extends="notLoggedInLayout">
<put-attribute name="title" value="Login" />
<put-attribute name="navigation" value="" />
<put-attribute name="body" value="WEB-INF/pages/login/login.jsp" />
</definition>
我的 templatenotloggedin.jsp 看起来像这样:
<%@ taglib
uri="http://tiles.apache.org/tags-tiles"
prefix="tiles"
%>
<!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"
>
<link
type="text/css"
rel="stylesheet"
href="<tiles:getAsString name='css'/>"
/>
</head>
<body>
<tiles:insertAttribute name="header" />
<tiles:insertAttribute name="body" />
<tiles:insertAttribute name="footer" />
</body>
</html>
我的问题是形成的页面如下所示:
<!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"
>
<link
type="text/css"
rel="stylesheet"
href="css/style.css"
/>
</head>
<body>
WEB-INF/pages/template/notloggedinheader.jsp
WEB-INF/pages/login/login.jspsadsdf
WEB-INF/pages/template/footer.jsp
</body>
</html>
有谁知道我做错了什么?