Antonio Petrelli wrote:
2010/6/8 Jorge Vasquez <[email protected]>:
I'm starting to use tiles+freemarker for my project.  I am trying to figure
out a way to not have to use the tiles.xml file as I think it's simpler for
everyone in my team if we just deal with pages and each page includes the
template that it is referencing.  I am using Struts2 with tiles 2.06.

I suggest you to use Tiles 2.2.1, because it has native support for Freemarker.

Unfortunately, when it renders it is not replacing properly the elements in
the template.

Can you elaborate on this? What is the final result and what do you expect?

Antonio
Thanks for your reply Antonio,

The main problem is that the tiles.insertAttribute tags are not being replaced by whatever I try to set using the tiles.putAttribute tags.

This is why I am getting in the browser:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles";]>
<html>
        <head>
                <@s.head/>
                <!-- TITLE -->
                <@tiles.insertAttribute name="title"/>
                <link rel=stylesheet type="text/css" href="style/style.css 
<view-source:http://localhost:8080/edate-admin/style/style.css>">
        </head>
        <!-- BODY BACKGROUND -->
        <body bottommargin="0" leftmargin="0" marginheight="0" marginwidth="0" 
rightmargin="0" topmargin="0"
                background=<@tiles.insertAttribute name="body_background"/> >
                <table width="780" height="143" cellpadding="0" cellspacing="0" 
border="0">

                        <tr valign="top">
                                <td width="780">
                                        <!-- LOGO -->
                                        <img src="<@tiles.insertAttribute name= 
<view-source:http://localhost:8080/edate-admin/%[email protected]%20name=>"logo"/>" width="780" 
height="143" border="0" alt="">
                                </td>
                        </tr>
                </table>
                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                        <td width="510">

                                <table width="510" cellpadding="5" cellspacing="5" 
border="0">
                                        <tr valign="top">
                                                <td width="510">
                                                        <!-- BODY -->
                                                        <@tiles.insertAttribute 
name="body" />
                                                </td>
                                        </tr>
                                        <tr valign="top">
                                                <td width="510">

                                                        <!-- FOOTER -->
                                                        <@tiles.insertAttribute 
name="footer" />
                                                </td>
                                        </tr>
                                </table>
                        </td>
                </table>
        </body>
</html>


Reply via email to