ストライプのレイアウトに問題が発生しています。ストライプのネストされたレイアウトの問題
メインレイアウト(main.jsp):メイン(sub_main.jsp)を拡張さ
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<s:layout-definition>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>{$title}</title>
</head>
<body>
<s:layout-component name="body"/>
</body>
</html>
</s:layout-definition>
サブレイアウト:今
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<s:layout-definition>
<s:layout-render name="/WEB-INF/jsp/common/main.jsp" title="${title}">
<s:layout-component name="body">
This is a test and this is from sub main
<div style="color: red; font-size: 5em;">
<s:layout-component name="subheader"/>
</div>
${body}
</s:layout-component>
</s:layout-render>
</s:layout-definition>
私は私はここでテストケースを提供します次のコード(なtest.jsp)でサブメインのレイアウトを使用して:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<s:layout-render name="/WEB-INF/jsp/common/sub_main.jsp" title="Test Page">
<s:layout-component name="subheader">
This is from the sub header component
</s:layout-component>
<s:layout-component name="body">
This is from body
</s:layout-component>
</s:layout-render>
しかし、ブラウザに、私は次のことを見ています:
これはテストされ、これは、身体
代わりに由来する
サブ主から、これは:
これはテストであり、これは、サブ主から
これはサブヘッダーコンポーネントからのものです
これはボディからです
上記のすべてのタイトルは、次のように表示されます。
"$ title"
私が間違っていることについてどのような身体が私に手がかりを与えることができますか?
@Keoki Zee、これはStripesフレームワークに特有のものですか? – kaushik
それは?私の謝罪、私はその時のことを思い出します。 –
@Kdeveloper、これについてお知りになりたいですか? – kaushik