0

I'm trying to set my tiles in a way that I have an inner template in a template. I can load the inner template but I can't load the innermost jsp files (accountContent). Below are my files snippet. The accountContent attribute jsps are just simple text

tiles.xml

<definition name="main-layout" template="/WEB-INF/jsp/cmsPages/main-layout.jsp">
    <put-attribute name="content" value="" />
</definition>
<definition name="main-account" extends="main-layout">
    <put-attribute name="content" value="/WEB-INF/jsp/cmsPages/main-account.jsp" />
    <put-attribute name="accountContent" value=""/>
</definition>
<definition name="main-account-siteList" extends="main-account">
    <put-attribute name="accountContent" value="/WEB-INF/jsp/cmsPages/main-account-siteList.jsp" />
</definition>
<definition name="main-account-userList" extends="main-layout">
    <put-attribute name="content" value="/WEB-INF/jsp/cmsPages/main-account.jsp" />
    <put-attribute name="accountContent" value="/WEB-INF/jsp/cmsPages/main-account-userList.jsp" />
</definition>

main-layout.jsp

<s:div class="inner">
    <tiles:insertAttribute name="content" ignore="true" />
</s:div>

main-account.jsp

<s:div class="account-content">
    aaaaa
    <tiles:insertAttribute name="accountContent" ignore="true" />
</s:div>

Eveytime I try to call the struts action for the tiles the accountContent is just empty. What am I doing wrong here?

EDIT: Additional notes. Tiles main-account-siteList and main-account-userList are the tiles that I'm calling. I'm trying them at the same time to test different setups

Edit2: added in main-account

Jiro Manio
  • 137
  • 10
  • You didn't put attribute for `accountContent` into your definition. – Roman C May 06 '16 at 09:58
  • sorry but where specifically? – Jiro Manio May 06 '16 at 10:01
  • In the `main-layout` of course or `main-account` or both what ever you try. – Roman C May 06 '16 at 10:01
  • so just as I thought, I can't have the tiles:insertAttribute in the 2nd template. What I'm doing is main-layout is a template, the body is the main-account. The accountContent is inside there. I was hoping that I can call still insert it – Jiro Manio May 06 '16 at 10:04
  • Just put an empty attribute. – Roman C May 06 '16 at 10:10
  • oh that yeah. i tried it earlier and forgot to put it back. added it, also edited my post. but still no cigar – Jiro Manio May 06 '16 at 10:12
  • Very unclear. What page are you viewing? What is not working? – Aleksandr M May 06 '16 at 15:27
  • @AleksandrM I'm trying to call main-account-siteList and main-account-userList. they contain simple txt just for displaying. But they are not displaying when I call them. What is displayed are just the main-layout and main-account. Hm maybe you cant think of it this way – Jiro Manio May 07 '16 at 04:50

0 Answers0