Thanks for your response. Your assumption is correct
in that my design is not very static and therefore
need the ability of dynamic embedded tiles (so the
first solution would not work).  However, you did give
me some good ideas and insight into how Tiles works. 
What I got out of all of this is is that it seems
Tiles was intented to work better with flatter
structures rather than this dynamic, tree structure
thing I'm trying to implement (tiles within tiles
within tiles, branching off into other tiles, etc). 
It certainly has that capability but my definition.xml
is getting UGLY... but it's worth it ;)


--- "Holman, Cal" <[EMAIL PROTECTED]> wrote:
> Terry>> Hard to tell from a snippet of an entire
> site but if the definition page does not define
> anything except the page.jsp and if you always have
> form_wrapper.jsp around each for then you could move
> form_wrapper.jsp functionality to page.jsp and
> simplify the design.  The other way to reduce is to
> have the functionality for form_wrapper .jsp in the
> formX.jsp.   The tiles context is only for the
> definition being used not for any embedded
> definitions so unless you take measures to pass
> attributes down tiles will not see them.  I pass the
> page definition being called for some menuing style
> changes but to do so you need to define a bean with
> the attribute in request scope then pluck it in the
> lower tiles definition. I have an example on my web
> site - if you look for the code for the level 3
> index you will see the same technique:
> http://www.calandva.com/holmansite/do/blog/blogging.
>  Although I have been having a lot of problems with
> my DSL connection over the last few weeks - so email
> me if you would like more info.
> 
> If you must do the nested definitions then you can
> pass the inner tiles insert parameter as a bean and
> script the formX.jsp.  This is pretty ugly and
> Cedric or someone else may know a better way - I
> just hacked this together.  First the hack:
> 
> In form_wrapper.jsp add this line where you want
> form1.jsp to be inserted:
> <tiles:insert name="<%=
> request.getAttribute("form").toString() %>"
> flush="true" />
> 
> Then in page.jsp you need to do two things the easy
> one is include form_wrapper.jsp:
> <tiles:insert attribute="body"  flush="true"/>
> or you could use your def calling a def routine.
> Also in page.jsp include a line near the top of the
> page prior to any tiles:insert tags to create the
> request scope bean this will make the form visible
> to the next tile:
> <tiles:useAttribute id="form" name="form"
> scope="request"/>
> 
> Now the definition can look like this:
>  <definition name="page" path="page.jsp"/>
> 
>  <definition name="form_type_page" extends="page">
>                 <put name="body"
> value="form_wrapper.jsp">
>         <put name="form" value="form1.jsp"/>
>  </definition>
> 
>  <definition name="form_page2"
> extends="form_type_page">
>         <put name="form" value="form2">
>  </definition>
> 
> I know it is messy - but it should work.
> 
> Cal
> 
> http://www.calandva.com/            Last update
> 08/01/03
> 
> 

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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

Reply via email to