I am using struts 1.1 with tiles.
I have tiles with definitions like
<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>
I want to be able to set the value of the body parameter in my java Action class. What would I get from the ActionMapping or ActionForm to do this?
public class TileForwardAction extends Action
{
public ActionForward execute(ActionMapping mapping, ActionForm arg1,
HttpServletRequest arg2, HttpServletResponse arg3) throws Exception
{
return mapping.findForward("theTile");
}
}
the struts config file looks like
<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>
Thank you
Inspired by the accepted answer I came up with the following solution
In the page defined in the tile def I have the following
<% String destAttr=(String)request.getAttribute("dest"); %>
<jsp:include page="<%=destAttr%>" flush="true" />
In the action class (because I was lazy) I have the following
request.setAttribute("dest", "landingB.jsp");
And it worked.