1

Tile configuration :


<definition name="*/*/*/*/*/index" extends="defaultLayout.{1}.{2}.{4}">
    <put-attribute name="headerLocationPart" >
    <definition name="indexLocation"  template="/{1}/{2}/mkportal/s/layouts/LocationLayout.jsp">
        <put-attribute name="location" value="/{1}/{2}/mkportal/s/location.jsp" />
        <put-attribute name="subscriptionBtn" value="/{1}/{2}/mkportal/s/subscriptionBtn.jsp" />
        <put-attribute name="indexPromo" value="/{1}/{2}/mkportal/s/indexPromo.jsp" />
        </definition>
  </put-attribute>
    <put-attribute name="body" value="/{1}/{2}/mkportal/s/index.jsp" />
</definition>

When I m going to hit URL from my browser

http://localhost:8080/etisalat/wap/mkportal/s/index.wfv

problem is Nested Definition "indexLocation" does not resolve {1},{2} parameter .


Error is


org.apache.tiles.impl.CannotRenderException: JSPException including path '/{1}/{2}/mkportal/s/layouts/LocationLayout.jsp'.

So I need solution to pass wildcard value to resolve nested tile definition.

Dharmesh
  • 132
  • 1
  • 12
  • Hi @mck can please provide ans for this problem, You are the one who solve my previous problem. – Dharmesh Jan 30 '15 at 05:52
  • sorry for slow response. you should sign up and ask on the tiles user mailing list for quicker response times. – mck Feb 06 '15 at 21:09

1 Answers1

3

Anonymous definitions can't have wildcards because they don't have names.

There is 2 different approaches you might take here (i don't know which is correct for you because i don't know exactly what you are doing)

1) You can use cascading="true" attributes instead of the additional definition like…

<definition name="*/*/*/*/*/index" extends="defaultLayout.{1}.{2}.{4}">
    <put-attribute name="headerLocationPart" template="/{1}/{2}/mkportal/s/layouts/LocationLayout.jsp"/>
    <put-attribute name="location" value="/{1}/{2}/mkportal/s/location.jsp" cascade="true"/>
    <put-attribute name="subscriptionBtn" value="/{1}/{2}/mkportal/s/subscriptionBtn.jsp" cascade="true"/>
    <put-attribute name="indexPromo" value="/{1}/{2}/mkportal/s/indexPromo.jsp" cascade="true"/>
    <put-attribute name="body" value="/{1}/{2}/mkportal/s/index.jsp" />
</definition>

2) You can use a named definition like…

    <definition name="indexLocation.*.*"  template="/{1}/{2}/mkportal/s/layouts/LocationLayout.jsp">
        <put-attribute name="location" value="/{1}/{2}/mkportal/s/location.jsp" />
        <put-attribute name="subscriptionBtn" value="/{1}/{2}/mkportal/s/subscriptionBtn.jsp" />
        <put-attribute name="indexPromo" value="/{1}/{2}/mkportal/s/indexPromo.jsp" />
    </definition>

<definition name="*/*/*/*/*/index" extends="defaultLayout.{1}.{2}.{4}">
    <put-attribute name="headerLocationPart" value="indexLocation.{1}.{2}"/>
    <put-attribute name="body" value="/{1}/{2}/mkportal/s/index.jsp" />
</definition>

Reference: http://tiles.apache.org/framework/tutorial/advanced/nesting-extending.html

mck
  • 1,152
  • 10
  • 10