RE: Please Help With Simple Tiles Problem
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: > " > flush="true" /> > > Then in page.jsp you need to do two things the easy > one is include form_wrapper.jsp: > > 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: > scope="request"/> > > Now the definition can look like this: > > > > value="form_wrapper.jsp"> > > > > extends="form_type_page"> > > > > 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]
RE: Please Help With Simple Tiles Problem
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: " flush="true" /> Then in page.jsp you need to do two things the easy one is include form_wrapper.jsp: 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: Now the definition can look like this: I know it is messy - but it should work. Cal http://www.calandva.com/Last update 08/01/03 -Original Message- From: Terry Brick [mailto:[EMAIL PROTECTED] Sent: Friday, August 01, 2003 15:20 To: [EMAIL PROTECTED] Subject: RE: Please Help With Simple Tiles Problem Thanks for your response David. Correct me if I'm wrong, but isn't this exactly what I had in my example? Maybe I'm just not grasping something... It looks to me like I'm still having to add two blocks for each form I want to add. Under your "form_page" definition you point to form1 -OR- form2. But in reality can't you only have one or the other? I have an struts action pointing to each form so wouldn't I have to do something like... So I would have an action pointing to "form_page1" and an action pointing two "form_page2". But I would have to add two definitions to my tiles-config file for each form. It just seems redundant to me. Sorry if I'm being dense, your patience is much appreciated :-) --- David Tobey <[EMAIL PROTECTED]> wrote: > Can you just create a generic definition for a "form > page". Then, switch out > what you put for the body. Like this: > > > > > > <-- OR: --> > > > > > > > > > > > ... etc ... > > Now you must create one new definition for each > form, but to use a different > one, just change what you use for the body of the > "form_page". > > dave > > > > -Original Message- > > From: Terry Brick > [mailto:[EMAIL PROTECTED] > > Sent: Thursday, July 31, 2003 10:55 PM > > To: Struts Users Mailing List > > Subject: Re: Please Help With Simple Tiles Problem > > > > > > Ok, I've finally gotten this to work. However, I > > don't think it's the "right" solution and it's > > certainly not one I'm happy with. But maybe by > > showing how I'm getting it to work, that will > better > > communicate to people what I'm trying SO HARD to > do. > > > > This works: > > > > > > > > > > > > > > > > > > > > > > > > So this gives me... > > > > > > > > > > > > > > The problem is that "form1.jsp" will not always be > > "form1.jsp". I want to be able to swap that for a > > "form2.jsp", "form3.jsp", etc. Using this method, > I > > would have to add TWO definitions into the > > tile-defs.xml for each new form I wanted! (form2, > > form2a, form3, form3a, etc) > > There must be a better way where I only have to > add a > > single definition for each new form. Any ideas? > > Advice is much appreciated. Thanks. > > > > > > > > > > __ > > Do you Yahoo
RE: Please Help With Simple Tiles Problem
Thanks for your response David. Correct me if I'm wrong, but isn't this exactly what I had in my example? Maybe I'm just not grasping something... It looks to me like I'm still having to add two blocks for each form I want to add. Under your "form_page" definition you point to form1 -OR- form2. But in reality can't you only have one or the other? I have an struts action pointing to each form so wouldn't I have to do something like... So I would have an action pointing to "form_page1" and an action pointing two "form_page2". But I would have to add two definitions to my tiles-config file for each form. It just seems redundant to me. Sorry if I'm being dense, your patience is much appreciated :-) --- David Tobey <[EMAIL PROTECTED]> wrote: > Can you just create a generic definition for a "form > page". Then, switch out > what you put for the body. Like this: > > > > > > <-- OR: --> > > > > > > > > > > > ... etc ... > > Now you must create one new definition for each > form, but to use a different > one, just change what you use for the body of the > "form_page". > > dave > > > > -Original Message- > > From: Terry Brick > [mailto:[EMAIL PROTECTED] > > Sent: Thursday, July 31, 2003 10:55 PM > > To: Struts Users Mailing List > > Subject: Re: Please Help With Simple Tiles Problem > > > > > > Ok, I've finally gotten this to work. However, I > > don't think it's the "right" solution and it's > > certainly not one I'm happy with. But maybe by > > showing how I'm getting it to work, that will > better > > communicate to people what I'm trying SO HARD to > do. > > > > This works: > > > > > > > > > > > > > > > > > > > > > > > > So this gives me... > > > > > > > > > > > > > > The problem is that "form1.jsp" will not always be > > "form1.jsp". I want to be able to swap that for a > > "form2.jsp", "form3.jsp", etc. Using this method, > I > > would have to add TWO definitions into the > > tile-defs.xml for each new form I wanted! (form2, > > form2a, form3, form3a, etc) > > There must be a better way where I only have to > add a > > single definition for each new form. Any ideas? > > Advice is much appreciated. Thanks. > > > > > > > > > > __ > > Do you Yahoo!? > > Yahoo! SiteBuilder - Free, easy-to-use web site > design software > > http://sitebuilder.yahoo.com > > > __ 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]
Re: Please Help With Simple Tiles Problem
Ok, I've finally gotten this to work. However, I don't think it's the "right" solution and it's certainly not one I'm happy with. But maybe by showing how I'm getting it to work, that will better communicate to people what I'm trying SO HARD to do. This works: So this gives me... The problem is that "form1.jsp" will not always be "form1.jsp". I want to be able to swap that for a "form2.jsp", "form3.jsp", etc. Using this method, I would have to add TWO definitions into the tile-defs.xml for each new form I wanted! (form2, form2a, form3, form3a, etc) There must be a better way where I only have to add a single definition for each new form. Any ideas? Advice is much appreciated. Thanks. __ 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]
Re: Please Help With Simple Tiles Problem
Thanks. I've seen that page and many other. Believe, I feel stupid from seeing so many examples and not being able to figure it out. But I'm getting a mental block somewhere that just isn't allowing me to grasp something. Barry Volpe <[EMAIL PROTECTED]> wrote:Tiles can function stand alone from struts but is incorporated in struts 1.1. Here is the website of the originator of tiles. Part way down the page are some example tiles war files that I found helpful. http://www.lifl.fr/~dumoulin/tiles/ Barry - Original Message - From: "Terry Brick" To: Sent: Thursday, July 31, 2003 3:42 PM Subject: Please Help With Simple Tiles Problem > > I'm using struts 1.1 and having trouble with a simple Tile function. I've searched the archives and doc, but for some reason I just can't seem to get a grip on a lot of this tile stuff. All I want to do is embed a tile within a tile within a page. Here's what I have now: > > > > tiles-defx.xml (snippet) > = > > > > > > > > > > > > > > > > > > > In layout.jsp (snippet) > === > > > > In wrapform.jsp (snippet) > > > > > > I get an error saying that my "form-body" attribute does not exist. And when I swap with , I don't get an error, but I also don't get my form-body content. I can see that what I have defined doesn't make much sense, but I can't figure it out. > What I want is, when I call "form.user" for it to give me the folloing content structure > (if these tags represented the content of JSP's) > > > > > > > > Could someone please show me how to do this? > Thank you > > > - > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software
Re: Please Help With Simple Tiles Problem
Tiles can function stand alone from struts but is incorporated in struts 1.1. Here is the website of the originator of tiles. Part way down the page are some example tiles war files that I found helpful. http://www.lifl.fr/~dumoulin/tiles/ Barry - Original Message - From: "Terry Brick" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 31, 2003 3:42 PM Subject: Please Help With Simple Tiles Problem > > I'm using struts 1.1 and having trouble with a simple Tile function. I've searched the archives and doc, but for some reason I just can't seem to get a grip on a lot of this tile stuff. All I want to do is embed a tile within a tile within a page. Here's what I have now: > > > > tiles-defx.xml (snippet) > = > > > > > > > > > > > > > > > > > > > In layout.jsp (snippet) > === > > > > In wrapform.jsp (snippet) > > > > > > I get an error saying that my "form-body" attribute does not exist. And when I swap with , I don't get an error, but I also don't get my form-body content. I can see that what I have defined doesn't make much sense, but I can't figure it out. > What I want is, when I call "form.user" for it to give me the folloing content structure > (if these tags represented the content of JSP's) > > > > > > > > Could someone please show me how to do this? > Thank you > > > - > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please Help With Simple Tiles Problem
I'm using struts 1.1 and having trouble with a simple Tile function. I've searched the archives and doc, but for some reason I just can't seem to get a grip on a lot of this tile stuff. All I want to do is embed a tile within a tile within a page. Here's what I have now: tiles-defx.xml (snippet) = In layout.jsp (snippet) === In wrapform.jsp (snippet) I get an error saying that my "form-body" attribute does not exist. And when I swap with , I don't get an error, but I also don't get my form-body content. I can see that what I have defined doesn't make much sense, but I can't figure it out. What I want is, when I call "form.user" for it to give me the folloing content structure (if these tags represented the content of JSP's) Could someone please show me how to do this? Thank you - Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software