Re: Can nested tile layouts be done?
I was able to get it working now. Thanks. On 8/16/05, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > It can get a little difficult to keep up with. > > Basically, you have to know the Hierarchy of your tile and call the top > most one. In this case, you would call .base which would intern call > myEndUserPage.page1 and finally myEndUserPage.jsp. to change to > another.jsp you would call .anotherPage in your action forward. Nesting > tiles can be very useful when switching components of a tile, but can > quickly become a headache when changing tiles in both layouts. I use the > nested for menus only and have been debating on switching to struts menu > because of the complexity. The only thing that has prevented me from doing > this is waiting to see if I can jump to JSF or AJAX/D-HTML instead. > > > [image: Inactive hide details for Daniel Hannum <[EMAIL PROTECTED]>]Daniel > Hannum <[EMAIL PROTECTED]> > > > > *Daniel Hannum <[EMAIL PROTECTED]>* > > 08/15/2005 04:55 PM Please respond to > "Struts Users Mailing List" < > user@struts.apache.org> > > > To > > Struts Users Mailing List > cc > > > Subject > > Re: Can nested tile layouts be done? > Thanks, I think this is better. I still must be missing something about > how > Tiles works internally, though. > > In my app, the tiles definition for the end user page (the one that > defines > "body") is called "endUserPage.tiles" and Tiles is smart enough to handle > requests for "endUserPage.jsp" in the correct "tiled" way. You have this > arranged differently, where the end user page definition has a more > cryptic > name (.myEndUserPage.page1) and is referenced by .base. > > If I do it your way, then, how does Tiles know which URL to map to the > tile > layout we just produced? I just implemented my layout the way you've > described, but now I don't know what URL to request because > tiles-config.xmlno longer contains URLs. > > > Thanks for your help > Dan > > On 8/15/05, [EMAIL PROTECTED] < > [EMAIL PROTECTED]> wrote: > > > > OK, I see: > > > > Your definition would need to extend .sublayout.. > > > > > > /layout/layout > > /layout/layout2 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > [image: Inactive hide details for Daniel Hannum <[EMAIL PROTECTED]>]Daniel > > > Hannum <[EMAIL PROTECTED]> > > > > > > > > *Daniel Hannum <[EMAIL PROTECTED]>* > > > > 08/15/2005 03:51 PM Please respond to > > "Struts Users Mailing List" < > > user@struts.apache.org> > > > > > > To > > > > Struts Users Mailing List > > cc > > > > > > Subject > > > > Re: Can nested tile layouts be done? > > This still isn't working for me. I need to tweak your example because > the > > value of "body" changes for each page. So if I add one more definition > to > > my > > tiles-config.xml for an actual end-user page that a user would point a > > browser to: > > > > > > > > > > > > It's not clear which of your definitions I should extend. If I extend > > .base > > (the logical choice), I get the same behavior where the layout.jsp is > > rendered and layout2.jsp is substituted in, but no substitutions are > made > > inside the layout2.jsp. If I extend .sublayout, I get even weirder > > behavior > > where it appears to render layout2.jsp but makes no substitutions at > all. > > > > I looked at the Tiles examples and they don't seem to define individual > > pages in the tiles-config.xml, as I did above. Could that be my problem? > > > > Dan > > > > On 8/15/05, [EMAIL PROTECTED] < > > [EMAIL PROTECTED]> wrote: > > > > > > Yes, this can be done. The VBox example is a good example of this. > > > > > > Basically it is laid out as follows. > > > > > > /layout/layout > > > /layout/layout2 > > > > > > > > > > > > > > > > > > > > > > > > > >
Re: Can nested tile layouts be done?
It can get a little difficult to keep up with. Basically, you have to know the Hierarchy of your tile and call the top most one. In this case, you would call .base which would intern call myEndUserPage.page1 and finally myEndUserPage.jsp. to change to another.jsp you would call .anotherPage in your action forward. Nesting tiles can be very useful when switching components of a tile, but can quickly become a headache when changing tiles in both layouts. I use the nested for menus only and have been debating on switching to struts menu because of the complexity. The only thing that has prevented me from doing this is waiting to see if I can jump to JSF or AJAX/D-HTML instead. Daniel Hannum <[EMAIL PROTECTED]> Daniel Hannum <[EMAIL PROTECTED]> 08/15/2005 04:55 PM Please respond to "Struts Users Mailing List" To Struts Users Mailing List cc Subject Re: Can nested tile layouts be done? Thanks, I think this is better. I still must be missing something about how Tiles works internally, though. In my app, the tiles definition for the end user page (the one that defines "body") is called "endUserPage.tiles" and Tiles is smart enough to handle requests for "endUserPage.jsp" in the correct "tiled" way. You have this arranged differently, where the end user page definition has a more cryptic name (.myEndUserPage.page1) and is referenced by .base. If I do it your way, then, how does Tiles know which URL to map to the tile layout we just produced? I just implemented my layout the way you've described, but now I don't know what URL to request because tiles-config.xmlno longer contains URLs. Thanks for your help Dan On 8/15/05, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > OK, I see: > > Your definition would need to extend .sublayout.. > > > /layout/layout > /layout/layout2 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > [image: Inactive hide details for Daniel Hannum <[EMAIL PROTECTED]>]Daniel > Hannum <[EMAIL PROTECTED]> > > > > *Daniel Hannum <[EMAIL PROTECTED]>* > > 08/15/2005 03:51 PM Please respond to > "Struts Users Mailing List" < > user@struts.apache.org> > > > To > > Struts Users Mailing List > cc > > > Subject > > Re: Can nested tile layouts be done? > This still isn't working for me. I need to tweak your example because the > value of "body" changes for each page. So if I add one more definition to > my > tiles-config.xml for an actual end-user page that a user would point a > browser to: > > > > > > It's not clear which of your definitions I should extend. If I extend > .base > (the logical choice), I get the same behavior where the layout.jsp is > rendered and layout2.jsp is substituted in, but no substitutions are made > inside the layout2.jsp. If I extend .sublayout, I get even weirder > behavior > where it appears to render layout2.jsp but makes no substitutions at all. > > I looked at the Tiles examples and they don't seem to define individual > pages in the tiles-config.xml, as I did above. Could that be my problem? > > Dan > > On 8/15/05, [EMAIL PROTECTED] < > [EMAIL PROTECTED]> wrote: > > > > Yes, this can be done. The VBox example is a good example of this. > > > > Basically it is laid out as follows. > > > > /layout/layout > > /layout/layout2 > > > > > > > > > > > > > > > > > > > > > > > > you can then substitute out different components of each section based > on > > what you are doing. > > > > > > > > > > [image: Inactive hide details for Daniel Hannum <[EMAIL PROTECTED]>]Daniel > > > Hannum <[EMAIL PROTECTED]> > > > > > > > > *Daniel Hannum <[EMAIL PROTECTED]>* > > > > 08/15/2005 02:18 PM Please respond to > > "Struts Users Mailing List" < > > user@struts.apache.org> > > > > > > To > > > > user@struts.apache.org > > cc > > > > > > Subject > > > > Can nested tile layouts be done? > > Hi everyone, I have a question about nesting layouts with Struts > > tiles. I've seen this sort of thing discussed in the past, but in > > searching I didn't see an example that I could apply to my situation, > > nor did I see a go
Re: Can nested tile layouts be done?
Thanks, I think this is better. I still must be missing something about how Tiles works internally, though. In my app, the tiles definition for the end user page (the one that defines "body") is called "endUserPage.tiles" and Tiles is smart enough to handle requests for "endUserPage.jsp" in the correct "tiled" way. You have this arranged differently, where the end user page definition has a more cryptic name (.myEndUserPage.page1) and is referenced by .base. If I do it your way, then, how does Tiles know which URL to map to the tile layout we just produced? I just implemented my layout the way you've described, but now I don't know what URL to request because tiles-config.xmlno longer contains URLs. Thanks for your help Dan On 8/15/05, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > OK, I see: > > Your definition would need to extend .sublayout.. > > > /layout/layout > /layout/layout2 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > [image: Inactive hide details for Daniel Hannum <[EMAIL PROTECTED]>]Daniel > Hannum <[EMAIL PROTECTED]> > > > > *Daniel Hannum <[EMAIL PROTECTED]>* > > 08/15/2005 03:51 PM Please respond to > "Struts Users Mailing List" < > user@struts.apache.org> > > > To > > Struts Users Mailing List > cc > > > Subject > > Re: Can nested tile layouts be done? > This still isn't working for me. I need to tweak your example because the > value of "body" changes for each page. So if I add one more definition to > my > tiles-config.xml for an actual end-user page that a user would point a > browser to: > > > > > > It's not clear which of your definitions I should extend. If I extend > .base > (the logical choice), I get the same behavior where the layout.jsp is > rendered and layout2.jsp is substituted in, but no substitutions are made > inside the layout2.jsp. If I extend .sublayout, I get even weirder > behavior > where it appears to render layout2.jsp but makes no substitutions at all. > > I looked at the Tiles examples and they don't seem to define individual > pages in the tiles-config.xml, as I did above. Could that be my problem? > > Dan > > On 8/15/05, [EMAIL PROTECTED] < > [EMAIL PROTECTED]> wrote: > > > > Yes, this can be done. The VBox example is a good example of this. > > > > Basically it is laid out as follows. > > > > /layout/layout > > /layout/layout2 > > > > > > > > > > > > > > > > > > > > > > > > you can then substitute out different components of each section based > on > > what you are doing. > > > > > > > > > > [image: Inactive hide details for Daniel Hannum <[EMAIL PROTECTED]>]Daniel > > > Hannum <[EMAIL PROTECTED]> > > > > > > > > *Daniel Hannum <[EMAIL PROTECTED]>* > > > > 08/15/2005 02:18 PM Please respond to > > "Struts Users Mailing List" < > > user@struts.apache.org> > > > > > > To > > > > user@struts.apache.org > > cc > > > > > > Subject > > > > Can nested tile layouts be done? > > Hi everyone, I have a question about nesting layouts with Struts > > tiles. I've seen this sort of thing discussed in the past, but in > > searching I didn't see an example that I could apply to my situation, > > nor did I see a good solution. > > > > Executive summary: > > > > What I want to do is have a simple layout containing two tiles, both > > of which are JSP's. However, one of those JSP's is actually another > > layout JSP, which itself contains tile placeholders. I can get Struts > > Tiles to do the substitutions for the first layout, but it seems to > > treat my second layout as a simple JSP and does not do further tiles > > substitutions in the second layout. > > > > Detailed description: > > > > We have two separate applications that share a common track bar at the > > top of the screen. Beyond that they are completely separate. So, we > > have a layout containing "trackbar" and "trackcontent". Trackbar is a > > common jsp as you can see below. Trackcontent is simply a blackbox > > representing the rest of the app. > > > >
Re: Can nested tile layouts be done?
OK, I see: Your definition would need to extend .sublayout.. /layout/layout /layout/layout2 Daniel Hannum <[EMAIL PROTECTED]> Daniel Hannum <[EMAIL PROTECTED]> 08/15/2005 03:51 PM Please respond to "Struts Users Mailing List" To Struts Users Mailing List cc Subject Re: Can nested tile layouts be done? This still isn't working for me. I need to tweak your example because the value of "body" changes for each page. So if I add one more definition to my tiles-config.xml for an actual end-user page that a user would point a browser to: It's not clear which of your definitions I should extend. If I extend .base (the logical choice), I get the same behavior where the layout.jsp is rendered and layout2.jsp is substituted in, but no substitutions are made inside the layout2.jsp. If I extend .sublayout, I get even weirder behavior where it appears to render layout2.jsp but makes no substitutions at all. I looked at the Tiles examples and they don't seem to define individual pages in the tiles-config.xml, as I did above. Could that be my problem? Dan On 8/15/05, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > Yes, this can be done. The VBox example is a good example of this. > > Basically it is laid out as follows. > > /layout/layout > /layout/layout2 > > > > > > > > > > > > you can then substitute out different components of each section based on > what you are doing. > > > > > [image: Inactive hide details for Daniel Hannum <[EMAIL PROTECTED]>]Daniel > Hannum <[EMAIL PROTECTED]> > > > > *Daniel Hannum <[EMAIL PROTECTED]>* > > 08/15/2005 02:18 PM Please respond to > "Struts Users Mailing List" < > user@struts.apache.org> > > > To > > user@struts.apache.org > cc > > > Subject > > Can nested tile layouts be done? > Hi everyone, I have a question about nesting layouts with Struts > tiles. I've seen this sort of thing discussed in the past, but in > searching I didn't see an example that I could apply to my situation, > nor did I see a good solution. > > Executive summary: > > What I want to do is have a simple layout containing two tiles, both > of which are JSP's. However, one of those JSP's is actually another > layout JSP, which itself contains tile placeholders. I can get Struts > Tiles to do the substitutions for the first layout, but it seems to > treat my second layout as a simple JSP and does not do further tiles > substitutions in the second layout. > > Detailed description: > > We have two separate applications that share a common track bar at the > top of the screen. Beyond that they are completely separate. So, we > have a layout containing "trackbar" and "trackcontent". Trackbar is a > common jsp as you can see below. Trackcontent is simply a blackbox > representing the rest of the app. > > > > > > Then I made two definitions that put in the appropriate subsititution > for trackcontent. *BUT* note that both of those JSP's have their own > Tiles placeholders called "menu" and "body". It's necessary to do this > because the apps may have different layouts but they must share the > trackbar above. > > > > > > > > > > Then, since all the pages of a single app share an app-specific menu, > I made another definition put the right page in for "menu" > > > > > > > > > > Lastly, we have two actual pages that extend the app definitions and > put the right values in for "body" > > > > > > > > > > Now, when I put all this together and point my browser at, say, > app1page1, I get the top-level layout and the trackbar rendered, and > it renders the appropriate trackcontent for app1, but it does NOT do > the second level of substitutions (i.e. substitute the correct menu > and body) > > Is Struts capable of doing this sort of two-level layout indirection? > If so, how should I change my tile defs and layouts to make it work. > > Thanks a lot! > Dan > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >
Re: Can nested tile layouts be done?
This still isn't working for me. I need to tweak your example because the value of "body" changes for each page. So if I add one more definition to my tiles-config.xml for an actual end-user page that a user would point a browser to: It's not clear which of your definitions I should extend. If I extend .base (the logical choice), I get the same behavior where the layout.jsp is rendered and layout2.jsp is substituted in, but no substitutions are made inside the layout2.jsp. If I extend .sublayout, I get even weirder behavior where it appears to render layout2.jsp but makes no substitutions at all. I looked at the Tiles examples and they don't seem to define individual pages in the tiles-config.xml, as I did above. Could that be my problem? Dan On 8/15/05, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > Yes, this can be done. The VBox example is a good example of this. > > Basically it is laid out as follows. > > /layout/layout > /layout/layout2 > > > > > > > > > > > > you can then substitute out different components of each section based on > what you are doing. > > > > > [image: Inactive hide details for Daniel Hannum <[EMAIL PROTECTED]>]Daniel > Hannum <[EMAIL PROTECTED]> > > > > *Daniel Hannum <[EMAIL PROTECTED]>* > > 08/15/2005 02:18 PM Please respond to > "Struts Users Mailing List" < > user@struts.apache.org> > > > To > > user@struts.apache.org > cc > > > Subject > > Can nested tile layouts be done? > Hi everyone, I have a question about nesting layouts with Struts > tiles. I've seen this sort of thing discussed in the past, but in > searching I didn't see an example that I could apply to my situation, > nor did I see a good solution. > > Executive summary: > > What I want to do is have a simple layout containing two tiles, both > of which are JSP's. However, one of those JSP's is actually another > layout JSP, which itself contains tile placeholders. I can get Struts > Tiles to do the substitutions for the first layout, but it seems to > treat my second layout as a simple JSP and does not do further tiles > substitutions in the second layout. > > Detailed description: > > We have two separate applications that share a common track bar at the > top of the screen. Beyond that they are completely separate. So, we > have a layout containing "trackbar" and "trackcontent". Trackbar is a > common jsp as you can see below. Trackcontent is simply a blackbox > representing the rest of the app. > > > > > > Then I made two definitions that put in the appropriate subsititution > for trackcontent. *BUT* note that both of those JSP's have their own > Tiles placeholders called "menu" and "body". It's necessary to do this > because the apps may have different layouts but they must share the > trackbar above. > > > > > > > > > > Then, since all the pages of a single app share an app-specific menu, > I made another definition put the right page in for "menu" > > > > > > > > > > Lastly, we have two actual pages that extend the app definitions and > put the right values in for "body" > > > > > > > > > > Now, when I put all this together and point my browser at, say, > app1page1, I get the top-level layout and the trackbar rendered, and > it renders the appropriate trackcontent for app1, but it does NOT do > the second level of substitutions (i.e. substitute the correct menu > and body) > > Is Struts capable of doing this sort of two-level layout indirection? > If so, how should I change my tile defs and layouts to make it work. > > Thanks a lot! > Dan > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >
Re: Can nested tile layouts be done?
Yes, this can be done. The VBox example is a good example of this. Basically it is laid out as follows. /layout/layout /layout/layout2 you can then substitute out different components of each section based on what you are doing. Daniel Hannum <[EMAIL PROTECTED]> Daniel Hannum <[EMAIL PROTECTED]> 08/15/2005 02:18 PM Please respond to "Struts Users Mailing List" To user@struts.apache.org cc Subject Can nested tile layouts be done? Hi everyone, I have a question about nesting layouts with Struts tiles. I've seen this sort of thing discussed in the past, but in searching I didn't see an example that I could apply to my situation, nor did I see a good solution. Executive summary: What I want to do is have a simple layout containing two tiles, both of which are JSP's. However, one of those JSP's is actually another layout JSP, which itself contains tile placeholders. I can get Struts Tiles to do the substitutions for the first layout, but it seems to treat my second layout as a simple JSP and does not do further tiles substitutions in the second layout. Detailed description: We have two separate applications that share a common track bar at the top of the screen. Beyond that they are completely separate. So, we have a layout containing "trackbar" and "trackcontent". Trackbar is a common jsp as you can see below. Trackcontent is simply a blackbox representing the rest of the app. Then I made two definitions that put in the appropriate subsititution for trackcontent. *BUT* note that both of those JSP's have their own Tiles placeholders called "menu" and "body". It's necessary to do this because the apps may have different layouts but they must share the trackbar above. Then, since all the pages of a single app share an app-specific menu, I made another definition put the right page in for "menu" Lastly, we have two actual pages that extend the app definitions and put the right values in for "body" Now, when I put all this together and point my browser at, say, app1page1, I get the top-level layout and the trackbar rendered, and it renders the appropriate trackcontent for app1, but it does NOT do the second level of substitutions (i.e. substitute the correct menu and body) Is Struts capable of doing this sort of two-level layout indirection? If so, how should I change my tile defs and layouts to make it work. Thanks a lot! Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can nested tile layouts be done?
Hi everyone, I have a question about nesting layouts with Struts tiles. I've seen this sort of thing discussed in the past, but in searching I didn't see an example that I could apply to my situation, nor did I see a good solution. Executive summary: What I want to do is have a simple layout containing two tiles, both of which are JSP's. However, one of those JSP's is actually another layout JSP, which itself contains tile placeholders. I can get Struts Tiles to do the substitutions for the first layout, but it seems to treat my second layout as a simple JSP and does not do further tiles substitutions in the second layout. Detailed description: We have two separate applications that share a common track bar at the top of the screen. Beyond that they are completely separate. So, we have a layout containing "trackbar" and "trackcontent". Trackbar is a common jsp as you can see below. Trackcontent is simply a blackbox representing the rest of the app. Then I made two definitions that put in the appropriate subsititution for trackcontent. *BUT* note that both of those JSP's have their own Tiles placeholders called "menu" and "body". It's necessary to do this because the apps may have different layouts but they must share the trackbar above. Then, since all the pages of a single app share an app-specific menu, I made another definition put the right page in for "menu" Lastly, we have two actual pages that extend the app definitions and put the right values in for "body" Now, when I put all this together and point my browser at, say, app1page1, I get the top-level layout and the trackbar rendered, and it renders the appropriate trackcontent for app1, but it does NOT do the second level of substitutions (i.e. substitute the correct menu and body) Is Struts capable of doing this sort of two-level layout indirection? If so, how should I change my tile defs and layouts to make it work. Thanks a lot! Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]