You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by bill curtis <bi...@gmail.com> on 2004/08/30 23:33:06 UTC

tile: including one layout .jsp inside another?

hello!!

I have been looking high and low for an answer to this problem.

I am trying to define a layout, one component of which is another layout:


  <definition name="main" path="/WEB-INF/jsp/layouts/main.jsp"> 
    <put name="top" value="/WEB-INF/jsp/common/top.jsp" />
    <put name="leftNav" value="/WEB-INF/jsp/common/leftNav.jsp" />
  </definition>


  <definition name="tabs" extends="main"> 
    <put name="body" value="/WEB-INF/jsp/foo/tabs.jsp" />
  </definition>

  <definition name="list" extends="tabs" >
    <put name="view" value="/WEB-INF/jsp/foo/list.jsp" /> 
  </definition>


  main.jsp:

  <html:html>
    <body>
      <tiles:insert attribute="top" />
      <tiles:insert attribute="leftNav" />
      <tiles:insert attribute="body" />
    </body>
  </html:html>


  tabs.jsp:

  <tiles:insert attribute="view" />


When I forward to "list", main loads, it's children, including tabs,
but when tabs tries to load list as a child, I get this error:

  [ServletException in:/WEB-INF/jsp/foo/tabs.jsp] 
      Error - Tag Insert : No value found for attribute 'view'.' 


I have tried numerous variants of my tiles defs and tiles tags, but I
can't get it to work.

Is there a way to do this?  If not, are there any recommended
workarounds that can be used to acheive the same effect?  Ideally,
tabs.jsp would not have it's component hard coded, I would like to be
able to select on the basis of the original forwards (which will come
from different action mappings and use different forms).

thanks & regards,
--bill

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org