You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Paul Benedict <pb...@apache.org> on 2013/04/18 20:50:10 UTC

Tiles 2 equivalent of rendering a nested tile?

I've been banging my head on this for about a day. I am trying to convert
to Tiles 2, but I haven't figured out the correct syntax of passing
attributes into a nested tile.

I am rendering the "Resources" def:
<definition name="DefaultLayout" template="/layout/default.jsp">
    <put-attribute name="header" value="/layout/header.jsp"/>
</definition>
<definition name="Resources" extends="DefaultLayout">
    <put-attribute name="Title" value="Resources" cascade="true"/>
    <put-attribute name="HelpId" value="10000" cascade="true"/>
    <put-attribute name="BannerImage" value="/img/logo.gif" cascade="true"/>
</definition>

default.jsp includes the "header":
<html>
<body>
  <tiles:insertAttribute name="header"/>
</body>
</html>

And header.jsp is supposed to consume the cascaded Title, HelpId, and
BannerImage attributes:
<tiles:getAsString name="Title"/>
<tiles:getAsString name="HelpId"/>
<tiles:getAsString name="BannerImage"/>

Unfortunately this isn't working. I get this exception trying to pull out
those attributes:
*tag.getAsString : component context is not defined. Check tag syntax
*
Any idea what is causing my headache?

Thanks,
Paul

Re: Tiles 2 equivalent of rendering a nested tile?

Posted by Paul Benedict <pb...@apache.org>.
Mick, in fact what I posted is against Tiles 3, but since it is beta status
and published last year, I figured it wasn't getting much traction and
would settle for a Tiles 2 answer. My mistake :-) I hope this helps.


On Thu, Apr 18, 2013 at 2:20 PM, Mick Semb Wever <mc...@apache.org> wrote:

> On Thu, 2013-04-18 at 13:50 -0500, Paul Benedict wrote:
> > I've been banging my head on this for about a day. I am trying to convert
> > to Tiles 2, but I haven't figured out the correct syntax of passing
> > attributes into a nested tile.
>
> Paul,
>  could you try using tiles-3?
>  our focus is there and so would be easier for us to help.
> ~mck
>
> --
> “If you would take, you must first give, this is the beginning of
> intelligence.” - Lao Tzu
>
> | http://github.com/finn-no | http://tech.finn.no |
>
>

Re: Tiles 2 equivalent of rendering a nested tile?

Posted by Mick Semb Wever <mc...@apache.org>.
On Thu, 2013-04-18 at 13:50 -0500, Paul Benedict wrote:
> I've been banging my head on this for about a day. I am trying to convert
> to Tiles 2, but I haven't figured out the correct syntax of passing
> attributes into a nested tile.

Paul,
 could you try using tiles-3?
 our focus is there and so would be easier for us to help.
~mck

-- 
“If you would take, you must first give, this is the beginning of
intelligence.” - Lao Tzu 

| http://github.com/finn-no | http://tech.finn.no |


Re: Tiles 2 equivalent of rendering a nested tile?

Posted by Paul Benedict <pb...@apache.org>.
Ah, you solved it. I was referencing the Struts 1 Tiles URI by accident. A
lousy oversight on my part. :-) Thank you.


On Fri, Apr 19, 2013 at 7:49 PM, Nicolas LE BAS <ma...@nlebas.net> wrote:

> On 13-04-18 02:50 PM, Paul Benedict wrote:
> > *tag.getAsString : component context is not defined. Check tag syntax
> > *
>
> Well, there is no such error message in tiles 2 nor tiles 3.
> There is one in struts-tiles, however.
>
> Are you sure you're using the right version of the taglib?
>
> Hope this helps,
> Nick.
>

Re: Tiles 2 equivalent of rendering a nested tile?

Posted by Nicolas LE BAS <ma...@nlebas.net>.
On 13-04-18 02:50 PM, Paul Benedict wrote:
> *tag.getAsString : component context is not defined. Check tag syntax
> *

Well, there is no such error message in tiles 2 nor tiles 3.
There is one in struts-tiles, however.

Are you sure you're using the right version of the taglib?

Hope this helps,
Nick.