You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Felipe Nascimento <fe...@inf.puc-rio.br> on 2003/12/01 06:41:42 UTC

recursive tiles

Hi,

I have the following definition in my tiles-defs.xml:
<definition name="mainTemplate" path="/mainTemplate.jsp">
   <put name="title" value="${title}" />
   <put name="header" value="/components/header.jsp" />
   <put name="menu" value="/componentes/menu.jsp" />
   <put name="body" value="" />
   <put name="footer" value="/componentes/footer.jsp" />
</definition>

<definition name="tile.foo" extends="mainTemplate">
   <put name="body" value="/foo.jsp" />
</definition>

In mainTemplate.jsp I have:
....
<tiles:get name="body"/>
....

What I want is to put more variable content in my foo.jsp, the same way I
put in mainTemplate.jsp
something like....

foo.jsp:
<tiles:get name="subBody1"/>
<tiles:get name="subBody2"/>

I tried some things here, but I always get a white screen in the body
region. (and I am not forgetting taglib in the beginning of jsp file).

Tks
Felipe



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


Re: RES: recursive tiles

Posted by Felipe Nascimento <fe...@inf.puc-rio.br>.
I´ll try that

tks a lot.

Felipe
----- Original Message ----- 
From: "Adam Hardy" <ah...@cyberspaceroad.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, December 02, 2003 8:18 AM
Subject: Re: RES: recursive tiles


Basically subbody1 & 2 are just extra tiles? Try this - your tiles-defs.xml:
<definition name="tile.foo" extends="mainTemplate">
    <put name="body" value="/foo.jsp" />
    <put name="subbody1" value="/foo2.jsp" />
    <put name="subbody2" value="/minifoo.jsp" />
</definition>

in your mainTemplate.jsp, you would have:
<tiles:get name="body">
    <put name="subbody1" beanName="subbody1"/>
    <put name="subbody2" beanName="subbody2"/>
</tiles:get>

in your foo.jsp you would have:
<tiles:insert attribute="subbody1" />

I haven't actually done tiles to 3 levels deep, just 2, but I've never
heard of any problems with it.

Adam

On 12/01/2003 08:52 PM Felipe Nascimento wrote:
> That is my what I don´t know.
> I don´t know if I have to define the two components subbody1 and 2 in my
> foo.jsp (body file), or in my tiles-defs.xml.
> I suppose it is better in my tiles-defs.xml. So in foo.jsp I could only
> get the values and that´s it.
>
> Could you give a simple example of the definition in tiles-defs.xml, the
> getting and putting in foo.jsp?
>
> In your code bellow (<put name="subbody1" value="subbody1"/>) where is
> defined subbody1? The name is the name in tiles-defs? And value is the
> jsp page?
>
> Tks a lot
> Felipe
>
> -----Mensagem original-----
> De: Adam Hardy [mailto:ahardy.struts@cyberspaceroad.com]
> Enviada em: segunda-feira, 1 de dezembro de 2003 08:41
> Para: Struts Users Mailing List
> Assunto: Re: recursive tiles
>
>
> Hi Felipe,
> not quite sure exactly what you want to do - where do you expect
> subbody1 & subbody2 to come from? If you are defining them in your
> tiles-defs.xml then you need to pass them as variables explicitly to
> 'body' in your maintemplate:
>
> <tiles:get name="body">
>    <put name="subbody1" value="subbody1"/>
> </tiles:get>
>
> HTH
> Adam
>
> On 12/01/2003 06:41 AM Felipe Nascimento wrote:
>
>>Hi,
>>
>>I have the following definition in my tiles-defs.xml: <definition
>>name="mainTemplate" path="/mainTemplate.jsp">
>>   <put name="title" value="${title}" />
>>   <put name="header" value="/components/header.jsp" />
>>   <put name="menu" value="/componentes/menu.jsp" />
>>   <put name="body" value="" />
>>   <put name="footer" value="/componentes/footer.jsp" /> </definition>
>>
>><definition name="tile.foo" extends="mainTemplate">
>>   <put name="body" value="/foo.jsp" />
>></definition>
>>
>>In mainTemplate.jsp I have:
>>....
>><tiles:get name="body"/>
>>....
>>
>>What I want is to put more variable content in my foo.jsp, the same
>>way I put in mainTemplate.jsp something like....
>>
>>foo.jsp:
>><tiles:get name="subBody1"/>
>><tiles:get name="subBody2"/>
>
>
>
>


-- 
struts 1.1 + tomcat 5.0.14 + java 1.4.2
Linux 2.4.20 RH9

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




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


Struts validator with Date property ???

Posted by "Mauricio T. Ferraz" <ma...@cilix.com.br>.
In my Form a hava a property java.util.Date, I can use the validator Struts?
Or I just can have properties "Strings" ??? in my textfiels on form???
In the Struts' webapps has a example, the use only String to input of
data...

I got

 java.lang.IllegalArgumentException: argument type mismatch


Thanks, for help.


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


Re: RES: recursive tiles

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Basically subbody1 & 2 are just extra tiles? Try this - your tiles-defs.xml:
<definition name="tile.foo" extends="mainTemplate">
    <put name="body" value="/foo.jsp" />
    <put name="subbody1" value="/foo2.jsp" />
    <put name="subbody2" value="/minifoo.jsp" />
</definition>

in your mainTemplate.jsp, you would have:
<tiles:get name="body">
    <put name="subbody1" beanName="subbody1"/>
    <put name="subbody2" beanName="subbody2"/>
</tiles:get>

in your foo.jsp you would have:
<tiles:insert attribute="subbody1" />

I haven't actually done tiles to 3 levels deep, just 2, but I've never 
heard of any problems with it.

Adam

On 12/01/2003 08:52 PM Felipe Nascimento wrote:
> That is my what I don´t know.
> I don´t know if I have to define the two components subbody1 and 2 in my
> foo.jsp (body file), or in my tiles-defs.xml.
> I suppose it is better in my tiles-defs.xml. So in foo.jsp I could only
> get the values and that´s it.
> 
> Could you give a simple example of the definition in tiles-defs.xml, the
> getting and putting in foo.jsp?
> 
> In your code bellow (<put name="subbody1" value="subbody1"/>) where is
> defined subbody1? The name is the name in tiles-defs? And value is the
> jsp page?
> 
> Tks a lot
> Felipe
> 
> -----Mensagem original-----
> De: Adam Hardy [mailto:ahardy.struts@cyberspaceroad.com] 
> Enviada em: segunda-feira, 1 de dezembro de 2003 08:41
> Para: Struts Users Mailing List
> Assunto: Re: recursive tiles
> 
> 
> Hi Felipe,
> not quite sure exactly what you want to do - where do you expect 
> subbody1 & subbody2 to come from? If you are defining them in your 
> tiles-defs.xml then you need to pass them as variables explicitly to 
> 'body' in your maintemplate:
> 
> <tiles:get name="body">
>    <put name="subbody1" value="subbody1"/>
> </tiles:get>
> 
> HTH
> Adam
> 
> On 12/01/2003 06:41 AM Felipe Nascimento wrote:
> 
>>Hi,
>>
>>I have the following definition in my tiles-defs.xml: <definition 
>>name="mainTemplate" path="/mainTemplate.jsp">
>>   <put name="title" value="${title}" />
>>   <put name="header" value="/components/header.jsp" />
>>   <put name="menu" value="/componentes/menu.jsp" />
>>   <put name="body" value="" />
>>   <put name="footer" value="/componentes/footer.jsp" /> </definition>
>>
>><definition name="tile.foo" extends="mainTemplate">
>>   <put name="body" value="/foo.jsp" />
>></definition>
>>
>>In mainTemplate.jsp I have:
>>....
>><tiles:get name="body"/>
>>....
>>
>>What I want is to put more variable content in my foo.jsp, the same 
>>way I put in mainTemplate.jsp something like....
>>
>>foo.jsp:
>><tiles:get name="subBody1"/>
>><tiles:get name="subBody2"/>
> 
> 
> 
> 


-- 
struts 1.1 + tomcat 5.0.14 + java 1.4.2
Linux 2.4.20 RH9

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


RES: recursive tiles

Posted by Felipe Nascimento <fe...@inf.puc-rio.br>.
That is my what I don´t know.
I don´t know if I have to define the two components subbody1 and 2 in my
foo.jsp (body file), or in my tiles-defs.xml.
I suppose it is better in my tiles-defs.xml. So in foo.jsp I could only
get the values and that´s it.

Could you give a simple example of the definition in tiles-defs.xml, the
getting and putting in foo.jsp?

In your code bellow (<put name="subbody1" value="subbody1"/>) where is
defined subbody1? The name is the name in tiles-defs? And value is the
jsp page?

Tks a lot
Felipe

-----Mensagem original-----
De: Adam Hardy [mailto:ahardy.struts@cyberspaceroad.com] 
Enviada em: segunda-feira, 1 de dezembro de 2003 08:41
Para: Struts Users Mailing List
Assunto: Re: recursive tiles


Hi Felipe,
not quite sure exactly what you want to do - where do you expect 
subbody1 & subbody2 to come from? If you are defining them in your 
tiles-defs.xml then you need to pass them as variables explicitly to 
'body' in your maintemplate:

<tiles:get name="body">
   <put name="subbody1" value="subbody1"/>
</tiles:get>

HTH
Adam

On 12/01/2003 06:41 AM Felipe Nascimento wrote:
> Hi,
> 
> I have the following definition in my tiles-defs.xml: <definition 
> name="mainTemplate" path="/mainTemplate.jsp">
>    <put name="title" value="${title}" />
>    <put name="header" value="/components/header.jsp" />
>    <put name="menu" value="/componentes/menu.jsp" />
>    <put name="body" value="" />
>    <put name="footer" value="/componentes/footer.jsp" /> </definition>
> 
> <definition name="tile.foo" extends="mainTemplate">
>    <put name="body" value="/foo.jsp" />
> </definition>
> 
> In mainTemplate.jsp I have:
> ....
> <tiles:get name="body"/>
> ....
> 
> What I want is to put more variable content in my foo.jsp, the same 
> way I put in mainTemplate.jsp something like....
> 
> foo.jsp:
> <tiles:get name="subBody1"/>
> <tiles:get name="subBody2"/>



-- 
struts 1.1 + tomcat 5.0.14 + java 1.4.2
Linux 2.4.20 RH9

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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.544 / Virus Database: 338 - Release Date: 25/11/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.544 / Virus Database: 338 - Release Date: 25/11/2003
 


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


Re: recursive tiles

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Hi Felipe,
not quite sure exactly what you want to do - where do you expect 
subbody1 & subbody2 to come from? If you are defining them in your 
tiles-defs.xml then you need to pass them as variables explicitly to 
'body' in your maintemplate:

<tiles:get name="body">
   <put name="subbody1" value="subbody1"/>
</tiles:get>

HTH
Adam

On 12/01/2003 06:41 AM Felipe Nascimento wrote:
> Hi,
> 
> I have the following definition in my tiles-defs.xml:
> <definition name="mainTemplate" path="/mainTemplate.jsp">
>    <put name="title" value="${title}" />
>    <put name="header" value="/components/header.jsp" />
>    <put name="menu" value="/componentes/menu.jsp" />
>    <put name="body" value="" />
>    <put name="footer" value="/componentes/footer.jsp" />
> </definition>
> 
> <definition name="tile.foo" extends="mainTemplate">
>    <put name="body" value="/foo.jsp" />
> </definition>
> 
> In mainTemplate.jsp I have:
> ....
> <tiles:get name="body"/>
> ....
> 
> What I want is to put more variable content in my foo.jsp, the same way I
> put in mainTemplate.jsp
> something like....
> 
> foo.jsp:
> <tiles:get name="subBody1"/>
> <tiles:get name="subBody2"/>



-- 
struts 1.1 + tomcat 5.0.14 + java 1.4.2
Linux 2.4.20 RH9

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