Ok Found the answer as to why this was not working. This may be trivial to seasoned users, but a hard catch for a newbie.
For components, such as the Header we have been talking about, the .java file AND the .tml file need to both reside in the components package. I had been putting the .tml file in the webroot and the .java for the component in components. Moved the .tml to components package and it works now. Bob -----Original Message----- From: Heck, Bob [mailto:[EMAIL PROTECTED] Sent: Friday, October 19, 2007 19:33 To: Tapestry users Subject: RE: Templates and t:body Ok, still have a problem. No error, just no header rendered. ------------------------------------------- Here is my Header.java file: package try.tapestry.components; public class Header { public Header() { } } -------------------------------------------- Here is my Header.tml file: <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> <body> <h1>This is a header</h1> </body> </html> -------------------------------------------- Here is my Start.tml <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> <title>Hello World Title</title> </head> <body> <t:Header /> Hello world. Start. </body> </html> ----------------------------------------------- Here is my Start.java package try.tapestry.pages; public class Start { public Start () { } } ------------------------------------------------- Here is the output when rendered (no header was inserted, just ignored. No errors.): <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><link href="/assets/tapestry/default.css" rel="stylesheet" type="text/css"><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>Hello World Title</title></head><body> Hello world. Start. </body></html> ------------------------------------------------- Any help is appreciated. I MUST be missing something so simple. Bob -----Original Message----- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: Friday, October 19, 2007 18:20 To: Tapestry users Subject: Re: Templates and t:body Tapestry mandates a certain organization to your classes. If you page class is org.example.pages.MyPage then your component class (here, Header) must be org.example.components.Header. The .pages. and .components. part is very specific to Tapestry, hard-wired into the framework. Those are packages that Tapestry scans at startup to locate page and component classes, and such classes must exist there (for Tapestry to perform runtime code transformation and hot class reloading). On 10/19/07, Heck, Bob <[EMAIL PROTECTED]> wrote: > > I created the Header.java and I am getting the same error: > Unable to resolve 'Header' to a component class name > > Here is my Header.java > > public class Header { > > public Header() > { > > } > } > > and my Header.tml > > <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> > <h1>This is a header</h1> > </html> > > > > Just to make sure, I dug into my classes files that were deployed and > the Header.class is there. > > Josh, what version of Tapestry are you using? I am using > 5.0.6-SNAPSHOT > > Angelo, what version are you using? > > Thanks in advance. > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf > Of Josh Canfield > Sent: Thursday, October 18, 2007 12:36 > To: Tapestry users > Subject: Re: Templates and t:body > > Did you create the Header.java? > > On 10/18/07, Angelo Chen <[EMAIL PROTECTED]> wrote: > > > > > > Hi Jonathan, > > > > I tried your approach, but does not work, here is my steps: > > > > 1. create a Header.html in component directory, it has only one > > line:<h2>hi my heading</h2> 2. I use it in my start.html: > > > > <html > > xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> > > <head> > > <title>Start Page</title> > > </head> > > <body> > > <h1>Start Page</h1> > > <t:Header /> > > </body> > > </html> > > > > It complains:Unable to resolve component type 'Header' to a > > component class name. > > > > Anything I'm missing here? Thanks, > > A.C. > > > > > > Jonathan Barker wrote: > > > > > > Sorry, I only answered half of your question. > > > > > > Including your standard header into hello.tml would be something like: > > > > > > <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> > > > <head> > > > <title>My Tapestry Application</title> > > > </head> > > > <body> > > > <t:header /> > > > My Page Specific Content > > > </body> > > > </html> > > > > > > > > >> -----Original Message----- > > >> From: Heck, Bob [mailto:[EMAIL PROTECTED] > > >> Sent: Thursday, October 18, 2007 12:27 PM > > >> To: Tapestry users > > >> Subject: RE: Templates and t:body > > >> > > >> Or, maybe I should just start at the top. > > >> > > >> I have a header that I want to display on every page. That > > >> header html > > >> (tml) markup is stored in the file header.tml > > >> > > >> How do I include this in another file, say hello.tml? What is > > >> the > > syntax > > >> and component usage? > > >> > > >> > > >> > > >> -----Original Message----- > > >> From: Thiago H de Paula Figueiredo [mailto:[EMAIL PROTECTED] > > >> Sent: Thursday, October 18, 2007 12:17 > > >> To: Tapestry users > > >> Subject: Re: Templates and t:body > > >> > > >> On Thu, 18 Oct 2007 13:05:48 -0300, Heck, Bob <[EMAIL PROTECTED]> > wrote: > > >> > > >> > So, how does layout.tml know to use specific.tml to fill in the > > >> > <t:body/> tag? Does it have to be injected somehow? Where > > >> > does it get a reference? How is this done? > > >> > > >> <t:body> just renders whatever was put inside your <t:layout> tag. > > >> ;) > > The > > >> specific page uses the layout, not the inverse. > > >> > > >> > > >> -- > > >> Thiago H. de Paula Figueiredo > > >> Desenvolvedor, Instrutor e Consultor de Tecnologia Eteg > > >> Tecnologia da Informação Ltda. > > >> http://www.eteg.com.br > > >> > > >> ----------------------------------------------------------------- > > >> -- > > >> -- To unsubscribe, e-mail: [EMAIL PROTECTED] > > >> For additional commands, e-mail: [EMAIL PROTECTED] > > >> > > >> > > >> ----------------------------------------------------------------- > > >> -- > > >> -- To unsubscribe, e-mail: [EMAIL PROTECTED] > > >> For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > ------------------------------------------------------------------ > > > -- > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > -- > > View this message in context: > > http://www.nabble.com/Templates-and-t%3Abody-tf4647900.html#a1327934 > > 4 Sent from the Tapestry - User mailing list archive at Nabble.com. > > > > > > -------------------------------------------------------------------- > > - To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > -- > TheDailyTube.com. Sign up and get the best new videos on the internet > delivered fresh to your inbox. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Partner and Senior Architect at Feature50 Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]