• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

use tiles to configure a "deep" layout

 
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,

let me start with an example to make my problem / misconception clear:

i have a tiles-config which describes my common page layout
(simplified


if have a page which assembles my jsp:



works fine. :-)

but say i have a component "userlist.jspf" on admin.jspf, which i want to use sometimes and from multiple places. i want to be able to insert it in my tiles config. or say i want to use admin.jspf in different configurations, sometimes with a userliser (for a super admin), sometimes without (for a normal admin).

i thought i put it like this:



no changes on page.jsp, but i like to insert


somewhere on admin.jspf.

does not work :-( <body_include> is unknown from within admin.jspf

i figured out that each <tiles:insert> creates a new ComponentContext, which is empty if i try to evaluate it from admin.jspf tried a lot with <tiles:importattribute>, but does not work either. :-(

what i'd like to achieve is clear: being able to control my page and all of its sub-components with one central definition. and evaluate it from all the way down the hierachy, not only from the first level (page.jsp).

any help appreaciated,
many thanks,
jan.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try adding this line in common/page.jsp, the page that assembles the tiles:

before the piece of code that inserts the body. Its worked for me, so should be the same for you.
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a million so far...

i see the parameter is written into the request, and i am able to dump it. but - stupid me - how am i able to call my appropriate insertion now?

this is in the request:


that's what i'm trying:


That's what I get:


note that the path is mixed up and wrong...

how are you calling / processing it?

many greetings,
jan
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


works like a charm...

many thanks again,
jan
 
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic