[EMAIL PROTECTED] wrote:
I was a beginner too, so don't be so cruel with yourself ;-) By the way,

Heh :-)

if you want to make something complicated, remember that you can put ANY
URL in your <put> element. For example, I put an Action's URL, so that it
loads some data. This Action forwards to a JSP page that will be displayed
only in that part of the page.

I don't think that helps me in this case, although it's an interesting point. I've been playing around with some different approaches but I'm fundamentally blocked by the fact that a JSP referenced in a tiles definition doesn't have access at render time to any other attributes in that tiles definition; that is to say, if I have the following definitions:


    <definition name="layout" path="/layout.jsp">
        <put name="title" value="TITLE"/>
        <put name="content" value="CONTENT"/>
    </definition>
    <definition name="foo" extends="layout">
        <put name="title" value="Page Title"/>
        <put name="content" value="page.jsp"/>
    </definition>

then foo.jsp can't contain a reference to the 'title' Tiles attribute.

I think I've worked out how to get what I want using tag files instead, so I'm going to try using them instead of Tiles and see if the problem gets any easier that way :-)

Page definitions are not recognized as correct paths by Struts, so that
you cannot call a page definition directly with an URL (please Struts team
correct me if I am wrong). You have two possibilities two show a Tiles
definition:
1. Through a JSP page, using:
<tiles:insert definition="nameofthedefinition" />
2. You can forward to a tiles definition, i.e. in your struts config you
can use:
<forward name="forwardname" path="nameofthedefinition" />
but you must modify the <controller> element in your struts-config.xml:

<controller
processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

Except that's how Struts is configured out of the box, so no config change required. However, I'm pretty sure Struts 1.1 threw an error if the path for a forward didn't begin with a '/'. Either that or I got confused by something else when I was first getting to grips with Tiles.


I remember because Struts in Action advised using Tiles .names.like.this and when I tried it I found I had to change it to /names.like.this to get past the error. As I say, though, I was just getting to grips with Tiles at the time, so I may have that all mixed up!

L.


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



Reply via email to