-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

Sorry for this lengthy mail but I am getting crazy!
I am working with Struts and Tiles and I am developing a small site to 
test (and stress this technology)

I reused some layouts taken from the tiles documentation. The standard 
page layout with the classical header, body, footer attributes and, in 
particular I took the vboxLayout:

<%
  Iterator i = list.iterator();
  while(i.hasNext()) {
    String name = (String)i.next();
%>
 <tiles:insert name="<%= name %>" flush="true"/>
<%
  }
%>

What I want is a page with the standard layout whose body is a vboxLayout 
with some tiles.

To do this I have to write the following files:
main.jsp
mainBody.jsp
t1.jsp
t2.jsp

Where main is a page which uses the standard layout, mainBody is a simple 
.jsp with only a 

<tiles:insert page="vboxLayout.jsp">
<tiles:putList name="list">
<tiles:add value="t1.jsp"/>
<tiles:add value="t2.jsp"/>
...
t1, t2 are .jsp tiles.

Now my questions are: 

1) The mainBody contains a list of tiles some of which might be text-only.
I would like to do something like this:
<tiles:insert page="vboxLayout.jsp">
<tiles:putList name="list">
<tiles:add value="t1.jsp"/>
<tiles:add type="string">This is an embedded text only tile</tiles:add>
...
In this way I would get rid of all the .jsp which contains only text/html 
and are peculiar to a single page. But this doesn't work.

2) Another problem is when a tile, let's say t1.jsp, needs some attributes 
to be passed in order to be instantiated. Let's suppose that the tile t1 
needs a title. How do I pass that attribute in the previous example?

<tiles:insert page="vboxLayout.jsp">
<tiles:putList name="list">
<tiles:add value="t1.jsp">
  <tiles:put name="title" value="Yupi"/>
</tiles:add>
<tiles:add value="t2.jsp"/>
...
Doesn't work. 

I tried to write a local definition before actually inserting the tile:

<tiles:definition id="instantiatedT1" page="t1.jsp">
<tiles:put name="title" value="Yupi"/>
</tiled:definition>

<tiles:insert page="vboxLayout.jsp">
<tiles:putList name="list">
<tiles:add value="instantiatedT1"/>
<tiles:add value="t2.jsp"/>
...
But this doesn't work too. I tried also to specify different scopes for 
the definition (even the application one!) and different types for the 
<tiles:add> tag (namely type="definition" and also 
beanName="instantiatedT1"). 
The only way I've found to make this work is to put the definition inside 
the tiles-config.xml, but this would be equivalent in having a separate t1.jsp 
with no parameters.

I suppose the problem is in the vboxLayout but I cannot figure out how to 
write a layout which supports what I said in 1).
The problem in 2) still has no solution (to me).

A presto,
Fabio

- -- 
- -----------------------------------------------------------------------------
 Fabio Mancinelli, PhD student     EMail : [EMAIL PROTECTED]
 Dipartimento di Informatica         WWW : http://www.di.univaq.it/~mancinel
 Universita' dell'Aquila    
- -----------------------------------------------------------------------------


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6

iD8DBQE+ZKrs6dsQbk2R3cMRArgjAKCcW4oqazE/lbRwXBnOEA7odtvTyACgzw9p
oSPR57Gl6YLcMAA6B08KZbo=
=BmVa
-----END PGP SIGNATURE-----



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to