tiles:insert で SAStrutsのActionの結果を挿入する。(うまくいなかい)
SAStrutsのチュートリアルのlayoutを使う事を想定
package tutorial.action; import javax.annotation.Resource; import org.seasar.struts.annotation.ActionForm; import org.seasar.struts.annotation.Execute; import tutorial.form.IncludeTestForm; public class IncludeTestAction { @ActionForm @Resource IncludeTestForm includeTestForm; @Execute(validator=false) public String index() { includeTestForm.message = "index"; return "index.jsp"; } @Execute(validator=false) public String included() { includeTestForm.message = "included"; return null; } }
- index.jsp
<%@page pageEncoding="UTF-8"%> <tiles:insert template="/WEB-INF/view/common/layout.jsp" flush="false"> <tiles:put name="title" value="Tiles"/> <tiles:put name="content" type="string"> <p>${f:h(message)}</p> <tiles:insert controllerUrl="/includeTest.do?SAStruts.method=included" page="included.jsp" flush="false"/> </tiles:put> </tiles:insert>
- included.jsp
<%@page pageEncoding="UTF-8"%> <p>${f:h(message)}</p>
- 出力結果予想
index included
- 実際
index index
なんで。。。