0
我正在使用struts 1.1和tile。如何在Struts action class中設置一個tile的主體URL?
我有一個定義瓷磚像
<definition name="cnmp.body.index" extends="cnmp.mainLayout" >
<put name="title" value="CNM Portal" />
<put name="bodytitle" value="Home" />
<put name="body" value="/00-CNM_Landing.jsp" />
</definition>
我希望能夠定身參數的值,在我的Java Action類。 我會從ActionMapping或ActionForm獲得什麼來做到這一點?
public class TileForwardAction extends Action
{
public ActionForward execute(ActionMapping mapping, ActionForm arg1,
HttpServletRequest arg2, HttpServletResponse arg3) throws Exception
{
return mapping.findForward("theTile");
}
}
的支柱配置文件看起來像
<action-mappings>
<action path = "/index"
type = "com.bellsouth.snt.cnmp.ui.action.TileForwardAction"
scope = "request"
input = "cnmp.body.index"
parameter= "theTile"
>
<forward name="theTile" path="cnmp.body.index"/>
</action>
謝謝
由我想出了以下解決方案
在定義的頁面接受的答案啓發瓷磚def我有以下
<% String destAttr=(String)request.getAttribute("dest"); %>
<jsp:include page="<%=destAttr%>" flush="true" />
在動作類(因爲我懶)我有以下
request.setAttribute("dest", "landingB.jsp");
和它的工作。