You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by andyhot <an...@di.uoa.gr> on 2006/10/24 21:04:07 UTC
Re: {SPAM?} RE: defining paths for templates
richard@2en40.nl wrote:
> I did create a library, in which I refer to the pages and jwc files
> explicitly. This seems to aid finding the pages and components, but
> not the templates.
That's weird... even the framework does this:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/Framework.library?view=markup
The exception page is defined in the library and found on the classpath.
Perhaps something else messes up things?
Do you have a custom specification or template resolver?
> Somehow the search-rule of finding the templates along with the
> components and pages in the same directory does not work.
>
>> I started out with all in the WEB-INF directory. If you want to put
>> the .html/.jwc files in the same directory as the .page you can,
>> Tapestry will find it automatically. Then the .java file can be
>> anywhere, you just specify it's location in the .jwc. That is the
>> simplest model. A bit more complicated is to create sub-directories
>> under the WEB-INF, then you have to tell Tapestry, via the
>> .application file where to find the components.
>>
>> A more complicated, but more in line with the Tapestry Model is to
>> create libraries, like "contrib". I started out with the simple
>> model and then needed to create libraries. Eventually, I wanted to
>> create libraries, in order to do that I had to move everything around.
>>
>> Creating libraries is pretty simple. In the directory/package for
>> the .java, I put the .html and the .jwc. I put a .library file and
>> jar it all together. Then I include the .library in the
>> .application. Then whenever, I want to reference one of my
>> components, I just prefix it like you would "contrib".
>>
>> HTH,
>>
>> Mark
>>
>> Mark J. Stang
>> Senior Engineer/Architect
>> office: +1 303.468.2900
>> mobile: +1 303.507.2833
>> Ping Identity
>>
>>
>>
>> -----Original Message-----
>> From: richard@2en40.nl [mailto:richard@2en40.nl]
>> Sent: Tue 10/24/2006 9:42 AM
>> To: users@tapestry.apache.org
>> Subject: defining paths for templates
>>
>> The people in the project I'm in prefer to keep the java-sources and
>> tapestry files that belong together in one and the same directory
>> (Home.java together with Home.page en Home.html, for example). This
>> basically means that all Tapestry-files will be placed outside of
>> WEB-INF.
>>
>> Now I finally succeded to get Tapestry to find the jwc and page files.
>> Alas, tapestry won't load the related templates. I even tried the
>> trick of using an asset, like this:
>>
>> <asset name="$template" path="Home.html"/>
>>
>> But this doesn't work either, as Tapestry complains about not being
>> able to find the html file on the class path. It also seems
>> superfluous to me, since tapestry is supposed to find the templates in
>> the same directory as the page or component files.
>>
>> If anyone has any pointers, I'll be grateful.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org